Summary: | Address escapes even though the called function does not cause it to escape | ||
---|---|---|---|
Product: | gcc | Reporter: | Andrew Pinski <pinskia> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | gcc-bugs, P.Schaffnit, rguenth |
Priority: | P2 | Keywords: | alias, missed-optimization |
Version: | 4.1.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2006-08-21 06:05:19 |
Description
Andrew Pinski
2005-07-29 13:40:01 UTC
Confirmed. I think the FIXME in tree-ssa-operands.c is the issue here: /* FIXME - if we have better information from the static vars analysis, we need to make the cache call site specific. This way we can have the performance benefits even if we are doing good optimization. */ The comment actually has nothing to do with the actual problem here ICC does not even do this optimization. I should note that Fortran code has something like this, except you don't need to know about the function that is being called, just the variable and if it has TARGET on it or not. r162134 at -O3: ;; Function h (h) h (int * a) { <bb 2>: *a_1(D) = 1; return; } ;; Function g (g) g () { int t1; int t; int t.0; int D.1984; <bb 2>: t = 0; h (&t); t1_1 = t; g1 (t1_1); t.0_2 = t; D.1984_3 = t1_1 == t.0_2; return D.1984_3; } r162134 at -O3 -fipa-pta: ;; Function h (h) h (int * a) { <bb 2>: *a_1(D) = 1; return; } ;; Function g (g) g () { int t1; int t; <bb 2>: t = 0; h (&t); t1_1 = t; g1 (t1_1); return 1; } Thus, fixed with -fipa-pta. Richi, test case for you? There is already testcases like this in gcc.dg/ipa/ipa-pta-*.c |