Patchwork Fix PR48147

login
register
mail settings
Submitter Richard Guenther
Date March 16, 2011, 1:55 p.m.
Message ID <alpine.LNX.2.00.1103161453590.25982@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/87257/
State New
Headers show

Comments

Richard Guenther - 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.

Richard.

2011-03-16  Richard Guenther  <rguenther@suse.de>

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

Patch

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" } } */