* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
@ 2007-02-25 11:33 ` eres at il dot ibm dot com
2007-02-25 14:50 ` eres at il dot ibm dot com
` (18 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-25 11:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from eres at il dot ibm dot com 2007-02-25 11:33 -------
Created an attachment (id=13105)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13105&action=view)
RTL unroller's dump (compiled with -fvariable-expansion-in-unroller)
reg:DF 137 is the new variable expansion created to expand the accumulator
reg:DF 120 [ add_acc.0 ].
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
2007-02-25 11:33 ` [Bug rtl-optimization/30957] " eres at il dot ibm dot com
@ 2007-02-25 14:50 ` eres at il dot ibm dot com
2007-02-25 14:52 ` eres at il dot ibm dot com
` (17 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-25 14:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from eres at il dot ibm dot com 2007-02-25 14:50 -------
The execution fails also when acc is float (and not double)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
2007-02-25 11:33 ` [Bug rtl-optimization/30957] " eres at il dot ibm dot com
2007-02-25 14:50 ` eres at il dot ibm dot com
@ 2007-02-25 14:52 ` eres at il dot ibm dot com
2007-02-26 11:46 ` eres at il dot ibm dot com
` (16 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-25 14:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from eres at il dot ibm dot com 2007-02-25 14:52 -------
Created an attachment (id=13107)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13107&action=view)
testcase for MVE
Running the executable of the attached testcase (compiled with MVE)
succeeded. This looks strange as it seems mzero6.c and this tetscase have
similar loop structure:
double acc = 0.0;
for (int i = 0; i <= n; i++)
acc += d;
return acc;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (2 preceding siblings ...)
2007-02-25 14:52 ` eres at il dot ibm dot com
@ 2007-02-26 11:46 ` eres at il dot ibm dot com
2007-02-26 13:51 ` eres at il dot ibm dot com
` (15 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-26 11:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from eres at il dot ibm dot com 2007-02-26 11:46 -------
Created an attachment (id=13113)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13113&action=view)
assembly file (PPC)
It seems that problem is in the initialization of the expansion
(which related to the sign of the init value).
The original accumulator is been initialized as follows:
fmr 0,1
rlwinm 0,3,0,29,31
while the expansion is been initialized as follows:
lis 11,.LC0@ha
lfs 13,.LC0@l(11)
when the expansion is been initialized with the value of the original
accumulator the program executed as expected.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (3 preceding siblings ...)
2007-02-26 11:46 ` eres at il dot ibm dot com
@ 2007-02-26 13:51 ` eres at il dot ibm dot com
2007-02-26 15:01 ` eres at il dot ibm dot com
` (14 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-26 13:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from eres at il dot ibm dot com 2007-02-26 13:51 -------
The reason that this tescase fails is because the expansion is been initialized
with +0, which means that it's final result will be +0 and not -0 as expected.
expansion += d --> expansion += -0 --> +0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (4 preceding siblings ...)
2007-02-26 13:51 ` eres at il dot ibm dot com
@ 2007-02-26 15:01 ` eres at il dot ibm dot com
2007-02-26 17:58 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-26 15:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from eres at il dot ibm dot com 2007-02-26 15:01 -------
It seems that initializing the expansion with -zero (instead of +zero)
will solve this problem.
According IEEE standard if we have -
x += something; initializing x with -0 will cause x to get the sign of
something.
-0 + (-0) = -0
-0 + (+0) = +0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (5 preceding siblings ...)
2007-02-26 15:01 ` eres at il dot ibm dot com
@ 2007-02-26 17:58 ` pinskia at gcc dot gnu dot org
2007-02-26 18:12 ` eres at il dot ibm dot com
` (12 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-26 17:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2007-02-26 17:57 -------
-ffast-math violates the IEEE standard in some cases so why is this option
being used to test an ieee math testcase?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (6 preceding siblings ...)
2007-02-26 17:58 ` pinskia at gcc dot gnu dot org
@ 2007-02-26 18:12 ` eres at il dot ibm dot com
2007-02-26 18:24 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-26 18:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from eres at il dot ibm dot com 2007-02-26 18:11 -------
MVE is enabled with -funsafe-math-optimizations as it changes the order of
summation. I think it should honor signed zero, which it does not in the
current implantation. I agree that -funsafe-math-optimizations is more
suitable than -fast-math as in the later signed zero is not been honored.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (7 preceding siblings ...)
2007-02-26 18:12 ` eres at il dot ibm dot com
@ 2007-02-26 18:24 ` pinskia at gcc dot gnu dot org
2007-02-26 18:34 ` eres at il dot ibm dot com
` (10 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-26 18:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2007-02-26 18:24 -------
Both -ffast-math and -funsafe-math-optimizations violate IEEE math specs so
this is an invalid bug. At one point -funsafe-math-optimizations used to not
honor signed zero but recently you have:
-flag_signed_zeros with
2007-01-19 Roger Sayle <roger@eyesopen.com>
* common.opt (fsigned-zeros): New command line option.
* flags.h (HONOR_SIGNED_ZEROS): Control via flag_signed_zeros instead
of flag_unsafe_math_optimizations.
* opts.c (set_fast_math_flags): The -ffast-math command line option
implies -fno-signed-zeros.
(fast_math_flags_set_p): Likewise.
But -funsafe-math-optimizations still says you can reassiocate so maybe this is
just the case where we want a flag for reassiocating.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (8 preceding siblings ...)
2007-02-26 18:24 ` pinskia at gcc dot gnu dot org
@ 2007-02-26 18:34 ` eres at il dot ibm dot com
2007-04-22 6:25 ` patchapp at dberlin dot org
` (9 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2007-02-26 18:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from eres at il dot ibm dot com 2007-02-26 18:34 -------
I think that the way -fnsafe-math-optimization violates ieee is important.
Introducing flag_signed_zeros, as you mensioned before, enforce
-fnsafe-math-optimization to honor signed zero. So I think MVE should honor
that too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (9 preceding siblings ...)
2007-02-26 18:34 ` eres at il dot ibm dot com
@ 2007-04-22 6:25 ` patchapp at dberlin dot org
2007-04-22 6:29 ` steven at gcc dot gnu dot org
` (8 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: patchapp at dberlin dot org @ 2007-04-22 6:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from patchapp at dberlin dot org 2007-04-22 07:25 -------
Subject: Bug number PR30957
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01378.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (10 preceding siblings ...)
2007-04-22 6:25 ` patchapp at dberlin dot org
@ 2007-04-22 6:29 ` steven at gcc dot gnu dot org
2007-05-09 6:27 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-04-22 6:29 UTC (permalink / raw)
To: gcc-bugs
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-04-22 07:29:14
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (11 preceding siblings ...)
2007-04-22 6:29 ` steven at gcc dot gnu dot org
@ 2007-05-09 6:27 ` pinskia at gcc dot gnu dot org
2008-01-09 18:31 ` ghazi at gcc dot gnu dot org
` (6 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-09 6:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from pinskia at gcc dot gnu dot org 2007-05-09 07:27 -------
This testcase (gcc.dg/pr30957-1.c) fails on spu-elf because spu-elf's float
almost always treat -0.0 as 0.0.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (12 preceding siblings ...)
2007-05-09 6:27 ` pinskia at gcc dot gnu dot org
@ 2008-01-09 18:31 ` ghazi at gcc dot gnu dot org
2008-01-10 15:32 ` eres at il dot ibm dot com
` (5 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2008-01-09 18:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from ghazi at gcc dot gnu dot org 2008-01-09 18:13 -------
This testcase has an execution failure on i686-pc-linux-gnu when using
-fpic/-fPIC.
http://gcc.gnu.org/ml/gcc-testresults/2008-01/msg00366.html
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ghazi at gcc dot gnu dot org
Last reconfirmed|2007-04-22 07:29:14 |2008-01-09 18:13:13
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (13 preceding siblings ...)
2008-01-09 18:31 ` ghazi at gcc dot gnu dot org
@ 2008-01-10 15:32 ` eres at il dot ibm dot com
2008-01-10 19:01 ` ubizjak at gmail dot com
` (4 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2008-01-10 15:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from eres at il dot ibm dot com 2008-01-10 15:05 -------
-fassociative-math and -fsigned-zeros flags can not co-exist.
I guess this testcase should be removed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (14 preceding siblings ...)
2008-01-10 15:32 ` eres at il dot ibm dot com
@ 2008-01-10 19:01 ` ubizjak at gmail dot com
2008-01-10 19:14 ` eres at il dot ibm dot com
` (3 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ubizjak at gmail dot com @ 2008-01-10 19:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from ubizjak at gmail dot com 2008-01-10 18:23 -------
(In reply to comment #13)
> This testcase has an execution failure on i686-pc-linux-gnu when using
> -fpic/-fPIC.
They also fail for non-pic compilations when the testcase _really_ executes the
test:
Index: testsuite/gcc.dg/pr30957-1.c
===================================================================
--- testsuite/gcc.dg/pr30957-1.c (revision 131441)
+++ testsuite/gcc.dg/pr30957-1.c (working copy)
@@ -7,7 +7,7 @@
extern void abort (void);
extern void exit (int);
-float
+float __attribute__((noinline))
foo (float d, int n)
{
unsigned i;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (15 preceding siblings ...)
2008-01-10 19:01 ` ubizjak at gmail dot com
@ 2008-01-10 19:14 ` eres at il dot ibm dot com
2009-01-17 2:56 ` ghazi at gcc dot gnu dot org
` (2 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: eres at il dot ibm dot com @ 2008-01-10 19:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from eres at il dot ibm dot com 2008-01-10 18:32 -------
This is because the test requires -fassociative-math for enabling the
variable-expansion as well as -fsigned-zeros for honor the sign of zero; but
they can not co-exist; also under -funsafe-math-optimizations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (16 preceding siblings ...)
2008-01-10 19:14 ` eres at il dot ibm dot com
@ 2009-01-17 2:56 ` ghazi at gcc dot gnu dot org
2009-11-22 18:02 ` ghazi at gcc dot gnu dot org
2010-03-30 17:17 ` ghazi at gcc dot gnu dot org
19 siblings, 0 replies; 21+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-01-17 2:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from ghazi at gcc dot gnu dot org 2009-01-17 02:56 -------
Reconfirming that gcc.dg/pr30957-1.c still XFAILs for me on x86_64.
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|ghazi at gcc dot gnu dot org|
Last reconfirmed|2008-01-09 18:13:13 |2009-01-17 02:56:20
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (17 preceding siblings ...)
2009-01-17 2:56 ` ghazi at gcc dot gnu dot org
@ 2009-11-22 18:02 ` ghazi at gcc dot gnu dot org
2010-03-30 17:17 ` ghazi at gcc dot gnu dot org
19 siblings, 0 replies; 21+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-11-22 18:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from ghazi at gcc dot gnu dot org 2009-11-22 18:01 -------
Still fails
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2009-01-17 02:56:20 |2009-11-22 18:01:42
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Bug rtl-optimization/30957] Misscompare with variable expansion optimization
2007-02-25 11:27 [Bug rtl-optimization/30957] New: Misscompare with variable expansion optimization eres at il dot ibm dot com
` (18 preceding siblings ...)
2009-11-22 18:02 ` ghazi at gcc dot gnu dot org
@ 2010-03-30 17:17 ` ghazi at gcc dot gnu dot org
19 siblings, 0 replies; 21+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2010-03-30 17:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from ghazi at gcc dot gnu dot org 2010-03-30 17:16 -------
gcc.dg/pr30957-1.c still XFAILs on x86_64-unknown-linux-gnu
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2009-11-22 18:01:42 |2010-03-30 17:16:58
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30957
^ permalink raw reply [flat|nested] 21+ messages in thread