public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413
@ 2013-04-30 12:29 izamyatin at gmail dot com
2013-04-30 15:43 ` [Bug tree-optimization/57124] " law at redhat dot com
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: izamyatin at gmail dot com @ 2013-04-30 12:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
Bug #: 57124
Summary: 254.gap@spec2000 got miscompare after r198413
Classification: Unclassified
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: izamyatin@gmail.com
Happens for example for option set "-O2 -ffast-math -march=corei7".
Unfortunately, now have no possibility to make some reproducer
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
@ 2013-04-30 15:43 ` law at redhat dot com
2013-04-30 19:20 ` law at redhat dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2013-04-30 15:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2013-04-30
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
2013-04-30 15:43 ` [Bug tree-optimization/57124] " law at redhat dot com
@ 2013-04-30 19:20 ` law at redhat dot com
2013-05-01 5:13 ` law at redhat dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2013-04-30 19:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
--- Comment #1 from Jeffrey A. Law <law at redhat dot com> 2013-04-30 19:20:19 UTC ---
It looks like range_fits_type_p may not be handling overflows correctly.
Investigating.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
2013-04-30 15:43 ` [Bug tree-optimization/57124] " law at redhat dot com
2013-04-30 19:20 ` law at redhat dot com
@ 2013-05-01 5:13 ` law at redhat dot com
2013-05-02 8:01 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2013-05-01 5:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
--- Comment #2 from Jeffrey A. Law <law at redhat dot com> 2013-05-01 05:13:38 UTC ---
__attribute__ ((noinline))
foo(short unsigned int *p1, short unsigned int *p2)
{
short unsigned int x1, x4;
int x2, x3, x5, x6;
unsigned int x7;
x1 = *p1;
x2 = (int) x1;
x3 = x2 * 65536;
x4 = *p2;
x5 = (int) x4;
x6 = x3 + x4;
x7 = (unsigned int) x6;
if (x7 <= 268435455U)
abort ();
exit (0);
}
main()
{
short unsigned int x, y;
x = -5;
y = -10;
foo (&x, &y);
}
Is a much reduced testcase. Ultimately we have a range for x6 that's [0,
+INF(OVF)] at which point it's not safe to replace x7 with x6 in the
conditional.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
` (2 preceding siblings ...)
2013-05-01 5:13 ` law at redhat dot com
@ 2013-05-02 8:01 ` rguenth at gcc dot gnu.org
2013-05-07 4:25 ` law at redhat dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-02 8:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-05-02 08:01:39 UTC ---
At least the reduced testcase contains undefined signed integer overflow.
It multiplies 65531 by 65536 here:
x3 = x2 * 65536;
it's still "miscompiled" with -fno-strict-overflow though, a QOI issue
(it works correctly with -fwrapv). The docs trying to point out the
difference between -fno-strict-overflow and -fwrapv are especially poor
(ISTR strongly objecting the notion of -f[no-]strict-overflow ...)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
` (3 preceding siblings ...)
2013-05-02 8:01 ` rguenth at gcc dot gnu.org
@ 2013-05-07 4:25 ` law at redhat dot com
2013-05-15 15:23 ` ysrumyan at gmail dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2013-05-07 4:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
--- Comment #4 from Jeffrey A. Law <law at redhat dot com> 2013-05-07 04:25:27 UTC ---
Yea, 254.gap is definitely overflowing signed types. I've got changes to make
the warnings and -fno-strict-overflow work that I'll put through their paces
tomorrow.
I think we should twiddle the testcase to verify we don't muck it up when
-fno-strict-overflow is active.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
` (4 preceding siblings ...)
2013-05-07 4:25 ` law at redhat dot com
@ 2013-05-15 15:23 ` ysrumyan at gmail dot com
2013-05-16 9:07 ` rguenth at gcc dot gnu.org
2013-05-24 17:22 ` law at redhat dot com
7 siblings, 0 replies; 9+ messages in thread
From: ysrumyan at gmail dot com @ 2013-05-15 15:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
Yuri Rumyantsev <ysrumyan at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ysrumyan at gmail dot com
--- Comment #6 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
We prepared a patch for 254.gap which resolves issue. So this bug can be
closed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
` (5 preceding siblings ...)
2013-05-15 15:23 ` ysrumyan at gmail dot com
@ 2013-05-16 9:07 ` rguenth at gcc dot gnu.org
2013-05-24 17:22 ` law at redhat dot com
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-16 9:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #4)
> Yea, 254.gap is definitely overflowing signed types. I've got changes to
> make the warnings and -fno-strict-overflow work that I'll put through their
> paces tomorrow.
>
> I think we should twiddle the testcase to verify we don't muck it up when
> -fno-strict-overflow is active.
Yes, that would be nice.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/57124] 254.gap@spec2000 got miscompare after r198413
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
` (6 preceding siblings ...)
2013-05-16 9:07 ` rguenth at gcc dot gnu.org
@ 2013-05-24 17:22 ` law at redhat dot com
7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2013-05-24 17:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57124
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Jeffrey A. Law <law at redhat dot com> ---
Trunk updated to only perform optimization when overflow semantics allow it.
254.gap should be compiling with -fno-strict-overflow to avoid the undefined
behaviour.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-05-24 17:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30 12:29 [Bug tree-optimization/57124] New: 254.gap@spec2000 got miscompare after r198413 izamyatin at gmail dot com
2013-04-30 15:43 ` [Bug tree-optimization/57124] " law at redhat dot com
2013-04-30 19:20 ` law at redhat dot com
2013-05-01 5:13 ` law at redhat dot com
2013-05-02 8:01 ` rguenth at gcc dot gnu.org
2013-05-07 4:25 ` law at redhat dot com
2013-05-15 15:23 ` ysrumyan at gmail dot com
2013-05-16 9:07 ` rguenth at gcc dot gnu.org
2013-05-24 17:22 ` law at redhat dot com
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).