Fix PR48147

Message ID alpine.LNX.2.00.1103161453590.25982@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener March 16, 2011, 1:55 p.m.
-flto with using the linker-plugin has an implicit -fwhole-program
effect which brings foo local and allows IPA-SRA to remove the
constant parameter.  The testcase does not want this and breaks
even without -flto if you make foo static.

Thus the following patch makes sure this doens't happen with -flto either.

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


2011-03-16  Richard Guenther  <>

	PR testsuite/48147
	* gcc.dg/guality/pr45882.c: Really make sure no inlining
	or cloning happens.


Index: gcc/testsuite/gcc.dg/guality/pr45882.c
--- gcc/testsuite/gcc.dg/guality/pr45882.c	(revision 171045)
+++ gcc/testsuite/gcc.dg/guality/pr45882.c	(working copy)
@@ -6,7 +6,7 @@  extern void abort (void);
 int a[1024];
 volatile short int v;
-__attribute__((noinline)) int
+__attribute__((noinline,noclone,used)) int
 foo (int i, int j)
   int b = i;		/* { dg-final { gdb-test 16 "b" "7" } } */