This fixes the testcase to not rely on the reference to
ashift_qi_1 being optimized out by RTL optimization via
help of the initregs pass that changes comparisons of
uninitialized data with a comparison that is always false.

Tested on x86_64-unknown-linux-gnu, pushed.

2021-08-11  Richard Biener  <rguent...@suse.de>

        * gcc.dg/lto/pr48622_1.c: Provide non-LTO definition
        of ashift_qi_1.
---
 gcc/testsuite/gcc.dg/lto/pr48622_1.c | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/lto/pr48622_1.c

diff --git a/gcc/testsuite/gcc.dg/lto/pr48622_1.c 
b/gcc/testsuite/gcc.dg/lto/pr48622_1.c
new file mode 100644
index 00000000000..4d05bae2114
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr48622_1.c
@@ -0,0 +1,6 @@
+/* { dg-options "-fno-lto" } */
+
+typedef unsigned int u8 __attribute__ ((mode (QI)));
+u8 ashift_qi_1 (u8)
+{
+}
-- 
2.31.1

Reply via email to