public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/30997] New: FRE does not value number comparisons in COND_EXPRs
@ 2007-02-28 19:00 rguenth at gcc dot gnu dot org
2007-02-28 19:20 ` [Bug tree-optimization/30997] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-28 19:00 UTC (permalink / raw)
To: gcc-bugs
int foo(int a) { int tmp = a > 2; if (a > 2) return tmp; }
is not simplified.
--
Summary: FRE does not value number comparisons in COND_EXPRs
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30997
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/30997] FRE does not value number comparisons in COND_EXPRs
2007-02-28 19:00 [Bug tree-optimization/30997] New: FRE does not value number comparisons in COND_EXPRs rguenth at gcc dot gnu dot org
@ 2007-02-28 19:20 ` pinskia at gcc dot gnu dot org
2007-12-03 15:44 ` [Bug tree-optimization/30997] FRE does not simplify " rguenth at gcc dot gnu dot org
2008-03-28 19:21 ` rguenth at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-28 19:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-02-28 19:20 -------
well that is undefined code anyways :)
int foo(int a) { int tmp = a > 2; if (a > 2) return tmp; return 10;}
Note we do simplify this later on after PRE/FRE as we sink the a>2 into the
other basic block and then VRP comes about and finds it is always true.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30997
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/30997] FRE does not simplify comparisons in COND_EXPRs
2007-02-28 19:00 [Bug tree-optimization/30997] New: FRE does not value number comparisons in COND_EXPRs rguenth at gcc dot gnu dot org
2007-02-28 19:20 ` [Bug tree-optimization/30997] " pinskia at gcc dot gnu dot org
@ 2007-12-03 15:44 ` rguenth at gcc dot gnu dot org
2008-03-28 19:21 ` rguenth at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-12-03 15:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2007-12-03 15:44 -------
Re-confirmed with SCCVN. Note that while it value numbers the COND_EXPR on
the RHS it does not simplify the condition in the COND_EXPR stmt:
Value numbering tmp_3 stmt = tmp_3 = a_2(D) > 2;
Setting value number of tmp_3 to tmp_3
<bb 2>:
tmp_3 = a_2(D) > 2;
if (a_2(D) > 2)
goto <bb 4>;
else
goto <bb 3>;
Even if you teach FRE to do elimination in COND_EXPR statements (which it
does not do), the COND_EXPR condition has no value handle associated and
a lookup with the expression in the PRE table fails.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dberlin at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-12-03 15:44:44
date| |
Summary|FRE does not value number |FRE does not simplify
|comparisons in COND_EXPRs |comparisons in COND_EXPRs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30997
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/30997] FRE does not simplify comparisons in COND_EXPRs
2007-02-28 19:00 [Bug tree-optimization/30997] New: FRE does not value number comparisons in COND_EXPRs rguenth at gcc dot gnu dot org
2007-02-28 19:20 ` [Bug tree-optimization/30997] " pinskia at gcc dot gnu dot org
2007-12-03 15:44 ` [Bug tree-optimization/30997] FRE does not simplify " rguenth at gcc dot gnu dot org
@ 2008-03-28 19:21 ` rguenth at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-28 19:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-03-28 19:21 -------
SCCVN now tries to simplify COND_EXPR conditions using their operands value
number. This still doesn't remove redundant comparisons.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30997
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-03-28 19:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-28 19:00 [Bug tree-optimization/30997] New: FRE does not value number comparisons in COND_EXPRs rguenth at gcc dot gnu dot org
2007-02-28 19:20 ` [Bug tree-optimization/30997] " pinskia at gcc dot gnu dot org
2007-12-03 15:44 ` [Bug tree-optimization/30997] FRE does not simplify " rguenth at gcc dot gnu dot org
2008-03-28 19:21 ` 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).