#include <stdint.h> extern void abort (void); uintptr_t __attribute__((pure,noinline,noclone)) foo (int *a) { return (uintptr_t) a; } void __attribute__((noinline,noclone)) bar (uintptr_t a) { int *p = (int *)a; *p = 1; } int main() { int t = 0; bar (foo (&t)); if (t != 1) abort (); return 0; } Related to PR45967.
Mine.
Which means, gcc.dg/tree-ssa/pr24287{,-2}.c are bogus.
Author: rguenth Date: Wed Oct 13 11:31:22 2010 New Revision: 165418 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165418 Log: 2010-10-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/45982 * tree-ssa-structalias.c (make_constraints_to): New function. (make_constraint_to): Implement in terms of make_constraints_to. (find_func_aliases): Properly make return values of pure/const functions escape if they assign to sth that is not a pointer. * gcc.dg/torture/pr45982.c: New testcase. * gcc.dg/tree-ssa/pr24287.c: Adjust. * gcc.dg/tree-ssa/pta-callused.c: Likewise. * gcc.dg/torture/pr39074-2.c: Likewise. Added: trunk/gcc/testsuite/gcc.dg/torture/pr45982.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/torture/pr39074-2.c trunk/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c trunk/gcc/tree-ssa-structalias.c
Author: rguenth Date: Wed Oct 13 11:33:51 2010 New Revision: 165419 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165419 Log: 2010-10-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/45982 * tree-ssa-structalias.c (make_constraints_to): New function. (make_constraint_to): Implement in terms of make_constraints_to. (find_func_aliases): Properly make return values of pure/const functions escape if they assign to sth that is not a pointer. * gcc.dg/torture/pr45982.c: New testcase. * gcc.dg/tree-ssa/pr24287.c: Adjust. * gcc.dg/tree-ssa/pta-callused.c: Likewise. * gcc.dg/torture/pr39074-2.c: Likewise. Added: branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/torture/pr45982.c Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/testsuite/ChangeLog branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/torture/pr39074-2.c branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c branches/gcc-4_5-branch/gcc/tree-ssa-structalias.c
Fixed on trunk and the 4.5 branch sofar, backport is possible.
4.3 branch is being closed, moving to 4.4.7 target.
Fixed in 4.5+, 4.4 is no longer supported.