public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
@ 2012-09-03 17:58 danglin at gcc dot gnu.org
2012-09-19 12:08 ` [Bug tree-optimization/54471] " rguenth at gcc dot gnu.org
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-09-03 17:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
Bug #: 54471
Summary: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: danglin@gcc.gnu.org
Host: hppa*-*-* (32-bit)
Target: hppa*-*-* (32-bit)
Build: hppa*-*-* (32-bit)
Executing on host: /home/dave/gnu/gcc/objdir/gcc/xgcc
-B/home/dave/gnu/gcc/objdir/gcc/
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/sms-8.c
-fno-diagnostics-show-caret -O2 -fmodulo-sched -fmodulo-sched-allow-regmoves
-fdump-rtl-sms --para
m sms-min-sc=1 -lm -o ./sms-8.exe (timeout = 300)spawn
/home/dave/gnu/gcc/objdir/gcc/xgcc -B/home/dave/gnu/gcc/objdir/gcc/
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/sms-8.c -fno-diagnostics-show-caret
-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param
sms-min-sc=1 -
lm -o ./sms-8.exe
PASS: gcc.dg/sms-8.c (test for excess errors)Setting LD_LIBRARY_PATH to
:/home/dave/gnu/gcc/objdir/gcc::/home/dave/gnu/gcc/objdir/gcc:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libstdc++-v3/src/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libmudflap/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libssp/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libgomp/.libs:/home/dave/gnu/gcc/objdir/hppa-linux-gnu/libatomic/.libs:/home/dave/gnu/gcc/objd
ir/./gcc:/home/dave/gnu/gcc/objdir/./prev-gcc
spawn [open ...]
FAIL: gcc.dg/sms-8.c execution test
(gdb) disass foo
Dump of assembler code for function foo:
0x00010608 <+0>: stw rp,-14(sp)
0x0001060c <+4>: ldo 40(sp),sp
=> 0x00010610 <+8>: b,l 0x103e0,rp
0x00010614 <+12>: nop
foo is reduced to a call to abort by tree optimizers.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
@ 2012-09-19 12:08 ` rguenth at gcc dot gnu.org
2012-11-20 12:06 ` jakub at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-19 12:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
2012-09-19 12:08 ` [Bug tree-optimization/54471] " rguenth at gcc dot gnu.org
@ 2012-11-20 12:06 ` jakub at gcc dot gnu.org
2012-11-21 2:27 ` dave.anglin at bell dot net
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-20 12:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed|2012-09-28 00:00:00 |2012-11-20
CC| |jakub at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-20 12:06:16 UTC ---
Can't reproduce that with a cross. The tree optimizers definitely don't
optimize it into abort, and neither the assembly looks like what you are
mentioning above.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
2012-09-19 12:08 ` [Bug tree-optimization/54471] " rguenth at gcc dot gnu.org
2012-11-20 12:06 ` jakub at gcc dot gnu.org
@ 2012-11-21 2:27 ` dave.anglin at bell dot net
2012-11-21 13:02 ` danglin at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dave.anglin at bell dot net @ 2012-11-21 2:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #2 from dave.anglin at bell dot net 2012-11-21 02:26:56 UTC ---
On 20-Nov-12, at 7:06 AM, jakub at gcc dot gnu.org wrote:
> Can't reproduce that with a cross. The tree optimizers definitely
> don't
> optimize it into abort, and neither the assembly looks like what you
> are
> mentioning above.
I'll recheck. I definitely remember looking at the RTL from the
expand pass.
That's why I marked it as a tree optimizer bug.
Dave
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (2 preceding siblings ...)
2012-11-21 2:27 ` dave.anglin at bell dot net
@ 2012-11-21 13:02 ` danglin at gcc dot gnu.org
2012-11-21 13:03 ` danglin at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-11-21 13:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #3 from John David Anglin <danglin at gcc dot gnu.org> 2012-11-21 13:01:33 UTC ---
Created attachment 28753
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28753
Tree dump
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (3 preceding siblings ...)
2012-11-21 13:02 ` danglin at gcc dot gnu.org
@ 2012-11-21 13:03 ` danglin at gcc dot gnu.org
2012-11-21 13:14 ` danglin at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-11-21 13:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> 2012-11-21 13:02:32 UTC ---
Created attachment 28754
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28754
Tree dump
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (4 preceding siblings ...)
2012-11-21 13:03 ` danglin at gcc dot gnu.org
@ 2012-11-21 13:14 ` danglin at gcc dot gnu.org
2012-11-21 13:37 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-11-21 13:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #5 from John David Anglin <danglin at gcc dot gnu.org> 2012-11-21 13:13:22 UTC ---
Get the same with stage1 compiler. Maybe this is a HWI32 issue?
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (5 preceding siblings ...)
2012-11-21 13:14 ` danglin at gcc dot gnu.org
@ 2012-11-21 13:37 ` jakub at gcc dot gnu.org
2012-11-21 13:56 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 13:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|hppa*-*-* (32-bit) |
Status|WAITING |NEW
Host|hppa*-*-* (32-bit) |
Build|hppa*-*-* (32-bit) |
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 13:36:56 UTC ---
Reproduced with
extern void abort (void);
__attribute__ ((noinline))
unsigned __int128
foo (__int128 ixi, unsigned ctr)
{
unsigned __int128 irslt = 1;
__int128 ix = ixi;
for (; ctr; ctr--)
{
irslt *= ix;
ix *= ix;
}
if (irslt != 14348907)
abort ();
return irslt;
}
int
main ()
{
unsigned __int128 res;
res = foo (3, 4);
return 0;
}
on x86_64-linux at -O2, seems to be a VRP bug.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (6 preceding siblings ...)
2012-11-21 13:37 ` jakub at gcc dot gnu.org
@ 2012-11-21 13:56 ` jakub at gcc dot gnu.org
2012-11-21 14:42 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 13:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 13:55:59 UTC ---
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (7 preceding siblings ...)
2012-11-21 13:56 ` jakub at gcc dot gnu.org
@ 2012-11-21 14:42 ` jakub at gcc dot gnu.org
2012-11-21 17:19 ` glisse at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 14:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 14:42:13 UTC ---
Created attachment 28755
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28755
gcc48-pr54471.patch
Untested fix. I believe the bug is in invalid canonicalization. When
sizem1 is { -1, -1 } double_int, sizem1 + double_int_one is { 0, 0 }, as it
wrapped, instead of { 0, 0, 1, 0 } quad_int. And if min0 or min1 is zero, then
size - min{0,1} is also zero, and so is very likely smaller than max{0,1}
(unless min{0,1} == max{0,1}), but we still don't want to "canonicalize" that
to signed. IMHO testing min2.is_zero () is sufficient, as min0 or min1 should
be a valid double_int in the range 0 to { -1, -1 }, which is always smaller
than the maximum unsigned integer + 1 in infinite precision and thus min2
should never be zero, unless size overflowed to 0 and min{0,1} is zero.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (8 preceding siblings ...)
2012-11-21 14:42 ` jakub at gcc dot gnu.org
@ 2012-11-21 17:19 ` glisse at gcc dot gnu.org
2012-11-21 17:32 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-21 17:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #9 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-21 17:18:47 UTC ---
Jakub, your patch makes sense to me (or min0.is_zero() and min1.is_zero()). I
am ashamed I managed to get products with [0,n] (with n larger than MAX/2)
wrong. Good thing Kenneth Zadeck's wide_int will soon allow us to remove most
of this horrible code.
Another test that shows the error (optimizes away the call to g):
void g();
void h();
void f(unsigned __int128 x){
if(x>(unsigned __int128)(-3))return;
unsigned __int128 y=2*x;
if(y==42) g();
else h();
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (9 preceding siblings ...)
2012-11-21 17:19 ` glisse at gcc dot gnu.org
@ 2012-11-21 17:32 ` jakub at gcc dot gnu.org
2012-11-26 9:20 ` jakub at gcc dot gnu.org
2012-11-26 9:26 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 17:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 17:31:58 UTC ---
Thanks, I'm going to include your test too then:
--- gcc/testsuite/gcc.dg/tree-ssa/vrp86.c.jj 2012-11-21 18:27:53.389280736
+0100
+++ gcc/testsuite/gcc.dg/tree-ssa/vrp86.c 2012-11-21 18:27:47.000000000
+0100
@@ -0,0 +1,26 @@
+/* PR tree-optimization/54471 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+#ifdef __SIZEOF_INT128__
+#define T __int128
+#else
+#define T long long
+#endif
+
+void fn1call ();
+void fn2call ();
+void f (unsigned T x)
+{
+ if (x > (unsigned T) -3)
+ return;
+ unsigned T y = 2 * x;
+ if (y == 42)
+ fn1call ();
+ else
+ fn2call ();
+}
+
+/* { dg-final { scan-tree-dump "fn1call" "vrp1"} } */
+/* { dg-final { scan-tree-dump "fn2call" "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (10 preceding siblings ...)
2012-11-21 17:32 ` jakub at gcc dot gnu.org
@ 2012-11-26 9:20 ` jakub at gcc dot gnu.org
2012-11-26 9:26 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-26 9:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-26 09:19:39 UTC ---
Author: jakub
Date: Mon Nov 26 09:19:30 2012
New Revision: 193806
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193806
Log:
PR tree-optimization/54471
* tree-vrp.c (extract_range_from_binary_expr_1): For MULT_EXPR,
don't canonicalize range if min2 is zero.
* gcc.dg/tree-ssa/vrp86.c: New test.
* gcc.c-torture/execute/pr54471.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr54471.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp86.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/54471] [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
` (11 preceding siblings ...)
2012-11-26 9:20 ` jakub at gcc dot gnu.org
@ 2012-11-26 9:26 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-26 9:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54471
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-26 09:26:14 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-11-26 9:26 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-03 17:58 [Bug tree-optimization/54471] New: [4.8 Regression] FAIL: gcc.dg/sms-8.c execution test danglin at gcc dot gnu.org
2012-09-19 12:08 ` [Bug tree-optimization/54471] " rguenth at gcc dot gnu.org
2012-11-20 12:06 ` jakub at gcc dot gnu.org
2012-11-21 2:27 ` dave.anglin at bell dot net
2012-11-21 13:02 ` danglin at gcc dot gnu.org
2012-11-21 13:03 ` danglin at gcc dot gnu.org
2012-11-21 13:14 ` danglin at gcc dot gnu.org
2012-11-21 13:37 ` jakub at gcc dot gnu.org
2012-11-21 13:56 ` jakub at gcc dot gnu.org
2012-11-21 14:42 ` jakub at gcc dot gnu.org
2012-11-21 17:19 ` glisse at gcc dot gnu.org
2012-11-21 17:32 ` jakub at gcc dot gnu.org
2012-11-26 9:20 ` jakub at gcc dot gnu.org
2012-11-26 9:26 ` jakub at gcc dot gnu.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).