public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y)
@ 2005-03-14 17:09 pthaugen at us dot ibm dot com
2005-03-14 17:12 ` [Bug tree-optimization/20470] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: pthaugen at us dot ibm dot com @ 2005-03-14 17:09 UTC (permalink / raw)
To: gcc-bugs
Noticed that gcc/g++ generate a branching sequence instead of straight-line code
for expressions of the form ABS(x-y). Changing the operator to something else
(+, *, /) resutls in straight-line code.
#define ABS(value) ( (value)>=0 ? (value) : -(value) )
int i,j,k,l,m,n;
void f1()
{
l = ABS(m+n);
i = ABS(j-k);
}
--
Summary: Branching sequence generated for ABS(x-y)
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pthaugen at us dot ibm dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc*-*-*
GCC host triplet: powerpc*-*-*
GCC target triplet: powerpc*-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
@ 2005-03-14 17:12 ` pinskia at gcc dot gnu dot org
2005-03-14 17:13 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-14 17:12 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-14 17:12 -------
Confirmed, I know where this comes from too, SPEC (but I had forgot which test).
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2005-03-14 17:12:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
2005-03-14 17:12 ` [Bug tree-optimization/20470] " pinskia at gcc dot gnu dot org
@ 2005-03-14 17:13 ` pinskia at gcc dot gnu dot org
2005-03-14 19:13 ` pthaugen at us dot ibm dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-14 17:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-14 17:13 -------
I will note I know there is an Apple radar about this bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
2005-03-14 17:12 ` [Bug tree-optimization/20470] " pinskia at gcc dot gnu dot org
2005-03-14 17:13 ` pinskia at gcc dot gnu dot org
@ 2005-03-14 19:13 ` pthaugen at us dot ibm dot com
2005-03-14 22:29 ` pthaugen at us dot ibm dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pthaugen at us dot ibm dot com @ 2005-03-14 19:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pthaugen at us dot ibm dot com 2005-03-14 19:13 -------
I noticed this in the twolf benchmark of SPEC, dimbox.c:new_dbox_a().
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
` (2 preceding siblings ...)
2005-03-14 19:13 ` pthaugen at us dot ibm dot com
@ 2005-03-14 22:29 ` pthaugen at us dot ibm dot com
2005-03-15 18:22 ` pthaugen at us dot ibm dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pthaugen at us dot ibm dot com @ 2005-03-14 22:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pthaugen at us dot ibm dot com 2005-03-14 22:29 -------
Decided to look into this myself, currently testing a patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
` (3 preceding siblings ...)
2005-03-14 22:29 ` pthaugen at us dot ibm dot com
@ 2005-03-15 18:22 ` pthaugen at us dot ibm dot com
2005-03-25 20:08 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pthaugen at us dot ibm dot com @ 2005-03-15 18:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pthaugen at us dot ibm dot com 2005-03-15 18:22 -------
Ditto here, except added additional call to negate_expr_p(arg2) to make sure it
was ok to flip the expression back to it's original form. Not sure if that was
necessary, was assuming I'd get comments when I posted a patch (hopefully soon,
had some problems with testing).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
` (4 preceding siblings ...)
2005-03-15 18:22 ` pthaugen at us dot ibm dot com
@ 2005-03-25 20:08 ` cvs-commit at gcc dot gnu dot org
2005-03-25 20:10 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-25 20:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-25 20:08 -------
Subject: Bug 20470
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: dje@gcc.gnu.org 2005-03-25 20:08:33
Modified files:
gcc : ChangeLog fold-const.c
Log message:
2005-03-25 Pat Haugen <pthaugen@us.ibm.com>
PR tree-optimization/20470
* fold-const.c (fold_cond_expr_with_comparison): Recognize/fold
ABS(x-y).
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7998&r2=2.7999
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.550&r2=1.551
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
` (5 preceding siblings ...)
2005-03-25 20:08 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-25 20:10 ` cvs-commit at gcc dot gnu dot org
2005-03-28 21:31 ` dje at gcc dot gnu dot org
2005-03-28 21:32 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-25 20:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-25 20:10 -------
Subject: Bug 20470
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: dje@gcc.gnu.org 2005-03-25 20:10:39
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg/tree-ssa: pr20470.c
Log message:
2005-03-25 Pat Haugen <pthaugen@us.ibm.com>
PR tree-optimization/20470
* gcc.dg/tree-ssa/pr20470.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5220&r2=1.5221
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr20470.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
` (6 preceding siblings ...)
2005-03-25 20:10 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-28 21:31 ` dje at gcc dot gnu dot org
2005-03-28 21:32 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: dje at gcc dot gnu dot org @ 2005-03-28 21:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dje at gcc dot gnu dot org 2005-03-28 21:31 -------
patch committed
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/20470] Branching sequence generated for ABS(x-y)
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
` (7 preceding siblings ...)
2005-03-28 21:31 ` dje at gcc dot gnu dot org
@ 2005-03-28 21:32 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-28 21:32 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20470
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-03-28 21:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-14 17:09 [Bug tree-optimization/20470] New: Branching sequence generated for ABS(x-y) pthaugen at us dot ibm dot com
2005-03-14 17:12 ` [Bug tree-optimization/20470] " pinskia at gcc dot gnu dot org
2005-03-14 17:13 ` pinskia at gcc dot gnu dot org
2005-03-14 19:13 ` pthaugen at us dot ibm dot com
2005-03-14 22:29 ` pthaugen at us dot ibm dot com
2005-03-15 18:22 ` pthaugen at us dot ibm dot com
2005-03-25 20:08 ` cvs-commit at gcc dot gnu dot org
2005-03-25 20:10 ` cvs-commit at gcc dot gnu dot org
2005-03-28 21:31 ` dje at gcc dot gnu dot org
2005-03-28 21:32 ` 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).