public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug tree-optimization/23134] New: Address escapes even though the called function does not cause it to escape @ 2005-07-29 13:40 pinskia at gcc dot gnu dot org 2005-07-29 13:43 ` [Bug tree-optimization/23134] " pinskia at gcc dot gnu dot org ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-07-29 13:40 UTC (permalink / raw) To: gcc-bugs Take this "stupid" example (even though this most likely shows up in GCC but I don't know for sure): int g1(int); static void h(int *a) { *a = 1; } int g(void) { int t = 0; h(&t); int t1 = t; g1(t1); return t1 == t; } That return should have been turned into "return 1" as t does not escape via h as h only touches it. Compile with -O3 -fno-inline to see the problem. -- Summary: Address escapes even though the called function does not cause it to escape Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape 2005-07-29 13:40 [Bug tree-optimization/23134] New: Address escapes even though the called function does not cause it to escape pinskia at gcc dot gnu dot org @ 2005-07-29 13:43 ` pinskia at gcc dot gnu dot org 2005-07-29 14:29 ` belyshev at depni dot sinp dot msu dot ru 2005-08-11 17:20 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-07-29 13:43 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Keywords| |alias http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape 2005-07-29 13:40 [Bug tree-optimization/23134] New: Address escapes even though the called function does not cause it to escape pinskia at gcc dot gnu dot org 2005-07-29 13:43 ` [Bug tree-optimization/23134] " pinskia at gcc dot gnu dot org @ 2005-07-29 14:29 ` belyshev at depni dot sinp dot msu dot ru 2005-08-11 17:20 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 8+ messages in thread From: belyshev at depni dot sinp dot msu dot ru @ 2005-07-29 14:29 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From belyshev at depni dot sinp dot msu dot ru 2005-07-29 13:57 ------- Confirmed. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2005-07-29 13:57:51 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape 2005-07-29 13:40 [Bug tree-optimization/23134] New: Address escapes even though the called function does not cause it to escape pinskia at gcc dot gnu dot org 2005-07-29 13:43 ` [Bug tree-optimization/23134] " pinskia at gcc dot gnu dot org 2005-07-29 14:29 ` belyshev at depni dot sinp dot msu dot ru @ 2005-08-11 17:20 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-08-11 17:20 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-11 17:20 ------- 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. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <bug-23134-6528@http.gcc.gnu.org/bugzilla/>]
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape [not found] <bug-23134-6528@http.gcc.gnu.org/bugzilla/> @ 2005-10-10 12:45 ` dberlin at gcc dot gnu dot org 2005-12-24 7:54 ` pinskia at gcc dot gnu dot org ` (2 subsequent siblings) 3 siblings, 0 replies; 8+ messages in thread From: dberlin at gcc dot gnu dot org @ 2005-10-10 12:45 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from dberlin at gcc dot gnu dot org 2005-10-10 12:45 ------- The comment actually has nothing to do with the actual problem here -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape [not found] <bug-23134-6528@http.gcc.gnu.org/bugzilla/> 2005-10-10 12:45 ` dberlin at gcc dot gnu dot org @ 2005-12-24 7:54 ` pinskia at gcc dot gnu dot org 2010-07-13 10:33 ` steven at gcc dot gnu dot org 2010-07-13 13:34 ` rguenth at gcc dot gnu dot org 3 siblings, 0 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-12-24 7:54 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from pinskia at gcc dot gnu dot org 2005-12-24 07:54 ------- 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. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape [not found] <bug-23134-6528@http.gcc.gnu.org/bugzilla/> 2005-10-10 12:45 ` dberlin at gcc dot gnu dot org 2005-12-24 7:54 ` pinskia at gcc dot gnu dot org @ 2010-07-13 10:33 ` steven at gcc dot gnu dot org 2010-07-13 13:34 ` rguenth at gcc dot gnu dot org 3 siblings, 0 replies; 8+ messages in thread From: steven at gcc dot gnu dot org @ 2010-07-13 10:33 UTC (permalink / raw) To: gcc-bugs ------- Comment #5 from steven at gcc dot gnu dot org 2010-07-13 10:33 ------- 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? -- steven at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu dot | |org Status|NEW |RESOLVED Resolution| |FIXED Target Milestone|--- |4.6.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/23134] Address escapes even though the called function does not cause it to escape [not found] <bug-23134-6528@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2010-07-13 10:33 ` steven at gcc dot gnu dot org @ 2010-07-13 13:34 ` rguenth at gcc dot gnu dot org 3 siblings, 0 replies; 8+ messages in thread From: rguenth at gcc dot gnu dot org @ 2010-07-13 13:34 UTC (permalink / raw) To: gcc-bugs ------- Comment #6 from rguenth at gcc dot gnu dot org 2010-07-13 13:34 ------- There is already testcases like this in gcc.dg/ipa/ipa-pta-*.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23134 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-07-13 13:34 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-07-29 13:40 [Bug tree-optimization/23134] New: Address escapes even though the called function does not cause it to escape pinskia at gcc dot gnu dot org 2005-07-29 13:43 ` [Bug tree-optimization/23134] " pinskia at gcc dot gnu dot org 2005-07-29 14:29 ` belyshev at depni dot sinp dot msu dot ru 2005-08-11 17:20 ` pinskia at gcc dot gnu dot org [not found] <bug-23134-6528@http.gcc.gnu.org/bugzilla/> 2005-10-10 12:45 ` dberlin at gcc dot gnu dot org 2005-12-24 7:54 ` pinskia at gcc dot gnu dot org 2010-07-13 10:33 ` steven at gcc dot gnu dot org 2010-07-13 13:34 ` rguenth at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).