* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
@ 2004-06-10 17:58 ` steven at gcc dot gnu dot org
2004-06-10 18:50 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-06-10 17:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2004-06-10 17:58 -------
This also happens on ia64.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-06-10 17:58:34
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
2004-06-10 17:58 ` [Bug tree-optimization/15911] " steven at gcc dot gnu dot org
@ 2004-06-10 18:50 ` pinskia at gcc dot gnu dot org
2004-06-10 22:24 ` dann at godzilla dot ics dot uci dot edu
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-10 18:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-10 18:50 -------
This is just like PR 13965.
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |13965, 15357
Severity|normal |enhancement
Keywords| |missed-optimization
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
2004-06-10 17:58 ` [Bug tree-optimization/15911] " steven at gcc dot gnu dot org
2004-06-10 18:50 ` pinskia at gcc dot gnu dot org
@ 2004-06-10 22:24 ` dann at godzilla dot ics dot uci dot edu
2004-06-10 22:27 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-06-10 22:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2004-06-10 22:24 -------
Hmmm, adding -march=athlon shows the same problem on i386.
The problem does not occur 0f -march=i386 is used.
The difference between the 2 cases above appears in the .t03.original dump:
For i386 the first "if" is translated to:
if (x > 5555 && y <= 6665)
the "&&" corresponds to a tree_andif_expr tree
for -march=athlon it is translated to:
if (#`truth_and_expr' not supported by pp_c_expression#)
here a truth_and_expr tree is used.
For i386 the && is transformed in cascading ifs, and DOM knows how to deal with
that.
For athlon the truth_and_expr is transformed to:
T.0 = x > 5555;
T.1 = y <= 6665;
T.2 = T.0 && T.1;
if (T.2) ....
In this case DOM does not infere that if T.2 is true then T.0 and T.1 are also
true.
The question is, should "&&" be lowered to different trees depending on the
target architecture?
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (2 preceding siblings ...)
2004-06-10 22:24 ` dann at godzilla dot ics dot uci dot edu
@ 2004-06-10 22:27 ` pinskia at gcc dot gnu dot org
2004-09-09 3:54 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-10 22:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-10 22:27 -------
Yes we know that this is a problem which is caused by BRANCH_COST, I had a start on a new pass
which makes the stuff done for BRANCH_COST later and not in fold but my HD died. I will see if I do
the pass over the next couple of weeks.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (3 preceding siblings ...)
2004-06-10 22:27 ` pinskia at gcc dot gnu dot org
@ 2004-09-09 3:54 ` pinskia at gcc dot gnu dot org
2005-05-08 19:18 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-09 3:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-09 03:53 -------
*** Bug 13965 has been marked as a duplicate of this bug. ***
--
Bug 15911 depends on bug 13965, which changed state.
Bug 13965 Summary: [tree-ssa] fold takes into account branch target information at tree level
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13965
What |Old Value |New Value
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (4 preceding siblings ...)
2004-09-09 3:54 ` pinskia at gcc dot gnu dot org
@ 2005-05-08 19:18 ` pinskia at gcc dot gnu dot org
2005-07-04 21:41 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-08 19:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-08 19:18 -------
I am no longer working on this.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] DOM optimization not performed
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (5 preceding siblings ...)
2005-05-08 19:18 ` pinskia at gcc dot gnu dot org
@ 2005-07-04 21:41 ` pinskia at gcc dot gnu dot org
2005-07-04 21:42 ` [Bug tree-optimization/15911] VRP/DOM does not like TRUTH_AND_EXPR pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-04 21:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-04 21:41 -------
*** Bug 20065 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] VRP/DOM does not like TRUTH_AND_EXPR
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (6 preceding siblings ...)
2005-07-04 21:41 ` pinskia at gcc dot gnu dot org
@ 2005-07-04 21:42 ` pinskia at gcc dot gnu dot org
2005-09-08 18:20 ` dnovillo at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-04 21:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-04 21:41 -------
VRP does not work on this either.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dnovillo at gcc dot gnu dot
| |org
Summary|DOM optimization not |VRP/DOM does not like
|performed |TRUTH_AND_EXPR
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] VRP/DOM does not like TRUTH_AND_EXPR
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (7 preceding siblings ...)
2005-07-04 21:42 ` [Bug tree-optimization/15911] VRP/DOM does not like TRUTH_AND_EXPR pinskia at gcc dot gnu dot org
@ 2005-09-08 18:20 ` dnovillo at gcc dot gnu dot org
2005-09-08 19:04 ` law at redhat dot com
2005-09-08 19:07 ` dnovillo at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-09-08 18:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2005-09-08 18:20 -------
This would be fixable inside VRP. Essentially we would need to insert chains of
ASSERT_EXPRs to represent various predicates:
D.1613_3 = x_2 > 5555;
D.1614_5 = y_4 <= 6665;
D.1615_6 = D.1613_3 && D.1614_5;
if (D.1615_6) goto <L0>; else goto <L8>;
At label L0, we know that:
D.1615_10 = 1;
D.1613_11 = 1;
D.1614_12 = 1;
y_13 = ASSERT_EXPR <y_4, y_4 <= 6665>;
x_14 = ASSERT_EXPR <x_2, x_2 > 5555>;
which is a bit sickening. It would be Much Better to avoid creating these
obtuse predicates in fold(), though.
Roger, Jeff, is there some hope for fixing this in fold() for 4.2? If not, I
can work on VRP to try an understand these chains.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |sayle at gcc dot gnu dot org
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] VRP/DOM does not like TRUTH_AND_EXPR
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (8 preceding siblings ...)
2005-09-08 18:20 ` dnovillo at gcc dot gnu dot org
@ 2005-09-08 19:04 ` law at redhat dot com
2005-09-08 19:07 ` dnovillo at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: law at redhat dot com @ 2005-09-08 19:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2005-09-08 19:04 -------
Subject: Re: VRP/DOM does not like
TRUTH_AND_EXPR
On Thu, 2005-09-08 at 18:20 +0000, dnovillo at gcc dot gnu dot org
wrote:
> ------- Additional Comments From dnovillo at gcc dot gnu dot org 2005-09-08 18:20 -------
>
> This would be fixable inside VRP. Essentially we would need to insert chains of
> ASSERT_EXPRs to represent various predicates:
>
> D.1613_3 = x_2 > 5555;
> D.1614_5 = y_4 <= 6665;
> D.1615_6 = D.1613_3 && D.1614_5;
> if (D.1615_6) goto <L0>; else goto <L8>;
>
> At label L0, we know that:
>
> D.1615_10 = 1;
> D.1613_11 = 1;
> D.1614_12 = 1;
> y_13 = ASSERT_EXPR <y_4, y_4 <= 6665>;
> x_14 = ASSERT_EXPR <x_2, x_2 > 5555>;
>
> which is a bit sickening. It would be Much Better to avoid creating these
> obtuse predicates in fold(), though.
Well, we have a long standing problem with fold using BRANCH_COST to
determine how best to implement certain conditionals. But even if that
were removed, it's fairly straightforward for a programmer (or better
yet some automated code generator) to create these "obtuse" predicates.
I think we'd be better off teaching VRP how to cope with this.
Jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/15911] VRP/DOM does not like TRUTH_AND_EXPR
2004-06-10 17:18 [Bug tree-optimization/15911] New: DOM optimization not performed dann at godzilla dot ics dot uci dot edu
` (9 preceding siblings ...)
2005-09-08 19:04 ` law at redhat dot com
@ 2005-09-08 19:07 ` dnovillo at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-09-08 19:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2005-09-08 19:07 -------
(In reply to comment #10)
> it's fairly straightforward for a programmer (or better
> yet some automated code generator) to create these "obtuse" predicates.
>
Good point. I'll work on a fix.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dnovillo at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15911
^ permalink raw reply [flat|nested] 12+ messages in thread