public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP [not found] <bug-31981-4@http.gcc.gnu.org/bugzilla/> @ 2011-04-14 19:04 ` pinskia at gcc dot gnu.org 0 siblings, 0 replies; 3+ messages in thread From: pinskia at gcc dot gnu.org @ 2011-04-14 19:04 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Target Milestone|--- |4.5.0 --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-14 19:04:46 UTC --- Fixed in 4.5.0 and above. ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr. @ 2007-05-17 22:49 pinskia at gcc dot gnu dot org 2007-05-25 10:22 ` [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP rguenth at gcc dot gnu dot org 2007-07-01 1:22 ` pinskia at gcc dot gnu dot org 0 siblings, 2 replies; 3+ messages in thread From: pinskia at gcc dot gnu dot org @ 2007-05-17 22:49 UTC (permalink / raw) To: gcc-bugs This testcase should pass: /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-forwprop" } */ /* We should be able to optimize this to b.t[i] = 1 during early optimizations. */ struct a { int t[10]; }; struct a b; void f(__SIZE_TYPE__ i) { int *c = b.t; c[i] = 1; } /* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */ /* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop2" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */ --------- I found this while fixing up forwprop for the pointer plus branch. -- Summary: Missed forw prop with indirect ref and addr. Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP 2007-05-17 22:49 [Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr pinskia at gcc dot gnu dot org @ 2007-05-25 10:22 ` rguenth at gcc dot gnu dot org 2007-07-01 1:22 ` pinskia at gcc dot gnu dot org 1 sibling, 0 replies; 3+ messages in thread From: rguenth at gcc dot gnu dot org @ 2007-05-25 10:22 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from rguenth at gcc dot gnu dot org 2007-05-25 11:21 ------- Indeed with -fno-tree-ccp the testcase is optimized by forwprop1 to <bb 2>: D.2000_3 = i_2(D) * 4; D.2001_4 = (int *) D.2000_3; D.2002_5 = &b.t[i_2(D)]; *D.2002_5 = 1; return; and then by forwprop2 to <bb 2>: D.2002_5 = &b.t[i_2(D)]; b.t[i_2(D)] = 1; return; so the right fix is to eventually teach CCP to do the first transformation, or rather teach fold_stmt to do a little tree combining in this case. Ugh. Or avoid this particular type of CCP. Ugh. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Missed forw prop with |Missed forw prop with |indirect ref and addr. |indirect ref and addr. due | |to CCP http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP 2007-05-17 22:49 [Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr pinskia at gcc dot gnu dot org 2007-05-25 10:22 ` [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP rguenth at gcc dot gnu dot org @ 2007-07-01 1:22 ` pinskia at gcc dot gnu dot org 1 sibling, 0 replies; 3+ messages in thread From: pinskia at gcc dot gnu dot org @ 2007-07-01 1:22 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from pinskia at gcc dot gnu dot org 2007-07-01 01:22 ------- > OFFSET + &OBJ. Well pointer plus was merged so it is always &OBJ + OFFSET :). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-14 19:04 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-31981-4@http.gcc.gnu.org/bugzilla/> 2011-04-14 19:04 ` [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP pinskia at gcc dot gnu.org 2007-05-17 22:49 [Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr pinskia at gcc dot gnu dot org 2007-05-25 10:22 ` [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP rguenth at gcc dot gnu dot org 2007-07-01 1:22 ` pinskia 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).