On Linux/x86, revision 171037 gave FAIL: gcc.dg/guality/pr45882.c -O2 -flto line 16 b == 7 FAIL: gcc.dg/guality/pr45882.c -O2 -flto line 16 c == 11 FAIL: gcc.dg/guality/pr45882.c -O2 -flto line 16 d == 112 FAIL: gcc.dg/guality/pr45882.c -O2 -flto line 16 e == 142 FAIL: gcc.dg/guality/pr45882.c -O2 -flto -flto-partition=none line 16 b == 7 FAIL: gcc.dg/guality/pr45882.c -O2 -flto -flto-partition=none line 16 c == 11 FAIL: gcc.dg/guality/pr45882.c -O2 -flto -flto-partition=none line 16 d == 112 FAIL: gcc.dg/guality/pr45882.c -O2 -flto -flto-partition=none line 16 e == 142 Revision 171030 is OK.
It is a new testcase, and all the failures you mention were failing with older gccs too as well. LTO and debug info simply has a long way to go.
True. Where and how do we try to handle constant params in clones? Quickly scanning ipa-cp.c and ipa-prop.c doesn't reveal anything. Oh - if it is early ipa-sra.c then I'm not surprised (same issues as early inlining probably).
Indeed - the linker plugin allows us to take foo() local. The problem can be reproduced w/o LTO with declaring foo static. Then you get FAIL: gcc.dg/guality/pr45882.c -O2 line 16 b == 7 FAIL: gcc.dg/guality/pr45882.c -O2 line 16 c == 11 FAIL: gcc.dg/guality/pr45882.c -O2 line 16 d == 112 FAIL: gcc.dg/guality/pr45882.c -O2 line 16 e == 142 FAIL: gcc.dg/guality/pr45882.c -O3 -fomit-frame-pointer line 16 b == 7 FAIL: gcc.dg/guality/pr45882.c -O3 -fomit-frame-pointer line 16 c == 11 FAIL: gcc.dg/guality/pr45882.c -O3 -fomit-frame-pointer line 16 d == 112 FAIL: gcc.dg/guality/pr45882.c -O3 -fomit-frame-pointer line 16 e == 142 FAIL: gcc.dg/guality/pr45882.c -O3 -g line 16 b == 7 FAIL: gcc.dg/guality/pr45882.c -O3 -g line 16 c == 11 FAIL: gcc.dg/guality/pr45882.c -O3 -g line 16 d == 112 FAIL: gcc.dg/guality/pr45882.c -O3 -g line 16 e == 142 FAIL: gcc.dg/guality/pr45882.c -Os line 16 b == 7 FAIL: gcc.dg/guality/pr45882.c -Os line 16 c == 11 FAIL: gcc.dg/guality/pr45882.c -Os line 16 d == 112 FAIL: gcc.dg/guality/pr45882.c -Os line 16 e == 142 as well. So the question is what does the testcase try to test? If you add used to the set of attributes of foo then the testcase passes with LTO as well. So LTO and -g works quite well ;)
Author: rguenth Date: Wed Mar 16 13:57:28 2011 New Revision: 171047 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171047 Log: 2011-03-16 Richard Guenther <rguenther@suse.de> PR testsuite/48147 * gcc.dg/guality/pr45882.c: Really make sure no inlining or cloning happens. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/guality/pr45882.c
Fixed.