public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation
@ 2004-03-21 22:50 pinskia at gcc dot gnu dot org
2004-03-21 22:52 ` [Bug optimization/14673] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-21 22:50 UTC (permalink / raw)
To: gcc-bugs
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom3" } */
int
foo2 (distance, i, j)
int distance;
int i, j;
{
int t = distance;
if (t <= 0)
t = ((t) >= 0 ? (t) : -(t));
return t;
}
/* There should be no ABS_EXPR. */
/* { dg-final { scan-tree-dump-times "ABS_EXPR " 0 "dom3"} } */
Noticed while looking to why a test fail (gcc.dg/tree-ssa/20030807-6.c) on the lno branch
after applying my patch to find ABS in phiopt.
--
Summary: [tree-ssa] DOM misses ABS to negative translation
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: enhancement
Priority: P2
Component: 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,law at gcc dot gnu dot
org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14673
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/14673] [tree-ssa] DOM misses ABS to negative translation
2004-03-21 22:50 [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation pinskia at gcc dot gnu dot org
@ 2004-03-21 22:52 ` pinskia at gcc dot gnu dot org
2004-03-22 2:09 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-21 22:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-21 22:52 -------
*** Bug 14674 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14673
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/14673] [tree-ssa] DOM misses ABS to negative translation
2004-03-21 22:50 [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation pinskia at gcc dot gnu dot org
2004-03-21 22:52 ` [Bug optimization/14673] " pinskia at gcc dot gnu dot org
@ 2004-03-22 2:09 ` pinskia at gcc dot gnu dot org
2004-05-04 19:45 ` law at redhat dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-22 2:09 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |tree-ssa
Version|3.4.0 |tree-ssa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14673
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/14673] [tree-ssa] DOM misses ABS to negative translation
2004-03-21 22:50 [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation pinskia at gcc dot gnu dot org
2004-03-21 22:52 ` [Bug optimization/14673] " pinskia at gcc dot gnu dot org
2004-03-22 2:09 ` pinskia at gcc dot gnu dot org
@ 2004-05-04 19:45 ` law at redhat dot com
2004-05-04 19:57 ` pinskia at gcc dot gnu dot org
2004-05-15 3:47 ` [Bug tree-optimization/14673] " law at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: law at redhat dot com @ 2004-05-04 19:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2004-05-04 19:45 -------
Subject: Re: New: [tree-ssa] DOM misses ABS to
negative translation
In message <20040321225046.14673.pinskia@gcc.gnu.org>, "pinskia at gcc dot gnu
dot org" writes:
>/* { dg-do compile } */
>/* { dg-options "-O1 -fdump-tree-dom3" } */
>int
>foo2 (distance, i, j)
> int distance;
> int i, j;
>{
> int t = distance;
> if (t <= 0)
> t = ((t) >= 0 ? (t) : -(t));
> return t;
>}
>
>/* There should be no ABS_EXPR. */
>/* { dg-final { scan-tree-dump-times "ABS_EXPR " 0 "dom3"} } */
>
>Noticed while looking to why a test fail (gcc.dg/tree-ssa/20030807-6.c) on
> the lno branch after applying my patch to find ABS in phiopt.
Sigh.
Given x LT 0 == true we would transform ABS into negation
x GE 0 == true we would eliminate ABS completely
[ These were performed with a single test of the available expression table. ]
That's not precisely what we want since if we had recorded x LE 0 == true
neither test would trigger, but we want to transform ABS into negation.
The right way to handle this is to do something like
x LE 0 == true turn abs into negation
x GE 0 == true eliminate abs completely
Which requires two checks of the available expression table. Easy 'nuff.
I'll check in a fix for this once the merge is complete.
Jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14673
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/14673] [tree-ssa] DOM misses ABS to negative translation
2004-03-21 22:50 [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-05-04 19:45 ` law at redhat dot com
@ 2004-05-04 19:57 ` pinskia at gcc dot gnu dot org
2004-05-15 3:47 ` [Bug tree-optimization/14673] " law at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-04 19:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-04 19:57 -------
Confirmed by Jeff Law.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-05-04 19:57:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14673
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/14673] [tree-ssa] DOM misses ABS to negative translation
2004-03-21 22:50 [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-05-04 19:57 ` pinskia at gcc dot gnu dot org
@ 2004-05-15 3:47 ` law at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: law at gcc dot gnu dot org @ 2004-05-15 3:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at gcc dot gnu dot org 2004-05-14 17:29 -------
Fixed with today's checkin to tree-ssa-dom.c
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14673
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-05-14 17:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-21 22:50 [Bug optimization/14673] New: [tree-ssa] DOM misses ABS to negative translation pinskia at gcc dot gnu dot org
2004-03-21 22:52 ` [Bug optimization/14673] " pinskia at gcc dot gnu dot org
2004-03-22 2:09 ` pinskia at gcc dot gnu dot org
2004-05-04 19:45 ` law at redhat dot com
2004-05-04 19:57 ` pinskia at gcc dot gnu dot org
2004-05-15 3:47 ` [Bug tree-optimization/14673] " law 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).