public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x
@ 2005-07-24 14:23 drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:24 ` [Bug tree-optimization/23049] " drab at kepler dot fjfi dot cvut dot cz
` (30 more replies)
0 siblings, 31 replies; 32+ messages in thread
From: drab at kepler dot fjfi dot cvut dot cz @ 2005-07-24 14:23 UTC (permalink / raw)
To: gcc-bugs
The example (attached below), when compiled by following gcc
-------------------
$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../../gcc-CVS-20050723/gcc-CVS-20050723/configure
--host=i686-pc-linux-gnu --prefix=/usr/local/opt/gcc-4.1
--exec-prefix=/usr/local/opt/gcc-4.1 --sysconfdir=/etc
--libdir=/usr/local/opt/gcc-4.1/lib --libexecdir=/usr/local/opt/gcc-4.1/libexec
--sharedstatedir=/var --localstatedir=/var --program-suffix=-4.1
--with-x-includes=/usr/X11R6/include --with-x-libraries=/usr/X11R6/lib
--enable-shared --enable-static --with-gnu-as --with-gnu-ld --with-stabs
--enable-threads=posix --enable-version-specific-runtime-libs --disable-coverage
--disable-libgcj --disable-checking --enable-multilib --with-x --enable-cmath
--enable-libstdcxx-debug --enable-fast-character --enable-hash-synchronization
--with-system-zlib --with-libbanshee --with-demangler-in-ld
--with-arch=athlon-xp --enable-libada --enable-languages=c,c++,f95,objc,ada
Thread model: posix
gcc version 4.1.0 20050723 (experimental)
---------------------
with
---------------------
gcc -O3 -ftree-vectorize -c -o ac3enc.o ac3enc.c
---------------------
results in this:
---------------------
gcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
---------------------
Tested on both i686-pc-linux-gnu and x86_64-pc-linux-gnu with the same result.
With -O2 -ftree-vectorize it compiles without problem.
Also gcc version 4.0.1 20050630 (prerelease) seems to take it without problems.
--
Summary: ICE with -O3 -ftree-vectorize on 4.1.x
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: drab at kepler dot fjfi dot cvut dot cz
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i?86-*-*, x86_64-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
@ 2005-07-24 14:24 ` drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:32 ` drab at kepler dot fjfi dot cvut dot cz
` (29 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: drab at kepler dot fjfi dot cvut dot cz @ 2005-07-24 14:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drab at kepler dot fjfi dot cvut dot cz 2005-07-24 14:23 -------
Created an attachment (id=9343)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9343&action=view)
Triggers the problem
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:24 ` [Bug tree-optimization/23049] " drab at kepler dot fjfi dot cvut dot cz
@ 2005-07-24 14:32 ` drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:35 ` drab at kepler dot fjfi dot cvut dot cz
` (28 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: drab at kepler dot fjfi dot cvut dot cz @ 2005-07-24 14:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drab at kepler dot fjfi dot cvut dot cz 2005-07-24 14:24 -------
It doesn't seem to be related to the Bug 23048 to me, so i reported it separately.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:24 ` [Bug tree-optimization/23049] " drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:32 ` drab at kepler dot fjfi dot cvut dot cz
@ 2005-07-24 14:35 ` drab at kepler dot fjfi dot cvut dot cz
2005-07-24 15:06 ` pinskia at gcc dot gnu dot org
` (27 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: drab at kepler dot fjfi dot cvut dot cz @ 2005-07-24 14:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drab at kepler dot fjfi dot cvut dot cz 2005-07-24 14:32 -------
Created an attachment (id=9344)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9344&action=view)
Seems to trigger the same problem
The behaviour is exactly the same as with my first example, so I'm adding this
just for completness. Although, it could also be a different bug that just
gives the same visible result for me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (2 preceding siblings ...)
2005-07-24 14:35 ` drab at kepler dot fjfi dot cvut dot cz
@ 2005-07-24 15:06 ` pinskia at gcc dot gnu dot org
2005-07-24 15:37 ` [Bug tree-optimization/23049] [4.1 Regression] " pinskia at gcc dot gnu dot org
` (26 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-24 15:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-24 14:57 -------
Reducing the first one. It is a stack overflow.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Severity|critical |normal
Keywords| |ice-on-valid-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (3 preceding siblings ...)
2005-07-24 15:06 ` pinskia at gcc dot gnu dot org
@ 2005-07-24 15:37 ` pinskia at gcc dot gnu dot org
2005-07-24 15:41 ` pinskia at gcc dot gnu dot org
` (25 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-24 15:37 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.1.0
Known to work| |4.0.0
Summary|ICE with -O3 -ftree- |[4.1 Regression] ICE with -
|vectorize on 4.1.x |O3 -ftree-vectorize on 4.1.x
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (4 preceding siblings ...)
2005-07-24 15:37 ` [Bug tree-optimization/23049] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-07-24 15:41 ` pinskia at gcc dot gnu dot org
2005-07-24 15:43 ` pinskia at gcc dot gnu dot org
` (24 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-24 15:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-24 15:37 -------
Reduced testcase for the first one:
static unsigned short int crc_table[256];
void AC3_encode_init(void)
{
unsigned int c, n, k;
for(n=0; n<256; n++)
{
c = n << 8;
for (k = 0; k < 8; k++)
{
if (c & (1 << 15))
c = ((c << 1) & 0xffff) ^ (((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16)) & 0xffff);
}
crc_table[n] = c;
}
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-07-24 15:37:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (5 preceding siblings ...)
2005-07-24 15:41 ` pinskia at gcc dot gnu dot org
@ 2005-07-24 15:43 ` pinskia at gcc dot gnu dot org
2005-07-24 15:56 ` belyshev at depni dot sinp dot msu dot ru
` (23 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-24 15:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-24 15:40 -------
Note the backtrace is:
#5211 0x003f58d0 in fold_ternary (code=COND_EXPR, type=0x1e0e5b0, op0=0x1ee9d50,
op1=0x1e18200, op2=0x1ee2080) at ../../gcc/fold-const.c:9905
#5212 0x003f8368 in fold_build3 (code=COND_EXPR, type=0x1e0e5b0, op0=0x1ee9d50,
op1=0x1e18200, op2=0x1ee2080) at ../../gcc/fold-const.c:10375
#5213 0x003bb030 in fold_cond_expr_with_comparison (type=0x1e0e5b0, arg0=0x1ee9d50,
arg1=0x1e18200, arg2=0x1ee2080) at ../../gcc/fold-const.c:4
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (6 preceding siblings ...)
2005-07-24 15:43 ` pinskia at gcc dot gnu dot org
@ 2005-07-24 15:56 ` belyshev at depni dot sinp dot msu dot ru
2005-07-24 16:01 ` pinskia at gcc dot gnu dot org
` (22 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-07-24 15:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From belyshev at depni dot sinp dot msu dot ru 2005-07-24 15:43 -------
(In reply to comment #5)
> Reduced testcase for the first one:
introduced between "2005-05-17 00:20 UTC" and "2005-05-18 00:20 UTC"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (7 preceding siblings ...)
2005-07-24 15:56 ` belyshev at depni dot sinp dot msu dot ru
@ 2005-07-24 16:01 ` pinskia at gcc dot gnu dot org
2005-07-24 16:15 ` belyshev at depni dot sinp dot msu dot ru
` (21 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-24 16:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-24 15:56 -------
The reduced testcase for the second one:
unsigned long CRCTab[256];
void InitCRC(void) {
int I, J;
unsigned long C;
for (I=0; I<256; I++)
{
for (C=I,J=0;J<8;J++)
C=(C & 1) ? (C>>1)^0xEDB88320L : (C>>1);
CRCTab[I]=C;
}
}
They do look like the same bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (8 preceding siblings ...)
2005-07-24 16:01 ` pinskia at gcc dot gnu dot org
@ 2005-07-24 16:15 ` belyshev at depni dot sinp dot msu dot ru
2005-07-27 10:51 ` dorit at il dot ibm dot com
` (20 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-07-24 16:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From belyshev at depni dot sinp dot msu dot ru 2005-07-24 16:13 -------
(In reply to comment #8)
> The reduced testcase for the second one:
to make it fail on amd64 one needs to change long -> int. and this testcase
started to fail at the same time as testcase in comment #5 .
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (9 preceding siblings ...)
2005-07-24 16:15 ` belyshev at depni dot sinp dot msu dot ru
@ 2005-07-27 10:51 ` dorit at il dot ibm dot com
2005-08-01 14:01 ` pinskia at gcc dot gnu dot org
` (19 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: dorit at il dot ibm dot com @ 2005-07-27 10:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dorit at il dot ibm dot com 2005-07-27 10:38 -------
This is triggered by tree-ifcvt (which is enabled by -ftree-vectorize)
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dpatel at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (10 preceding siblings ...)
2005-07-27 10:51 ` dorit at il dot ibm dot com
@ 2005-08-01 14:01 ` pinskia at gcc dot gnu dot org
2005-08-03 0:50 ` pinskia at gcc dot gnu dot org
` (18 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-01 14:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-01 14:01 -------
*** Bug 23179 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |micis at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (11 preceding siblings ...)
2005-08-01 14:01 ` pinskia at gcc dot gnu dot org
@ 2005-08-03 0:50 ` pinskia at gcc dot gnu dot org
2005-09-08 20:14 ` pinskia at gcc dot gnu dot org
` (17 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-03 0:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-03 00:49 -------
(In reply to comment #10)
> This is triggered by tree-ifcvt (which is enabled by -ftree-vectorize)
But it looks like not a vectorize or tree-ifcvt bug at all but a fold bug.
We get:
0 == 0 ? 0 : 3988292384
in fold but we don't try to fold 0 == 0 first.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (12 preceding siblings ...)
2005-08-03 0:50 ` pinskia at gcc dot gnu dot org
@ 2005-09-08 20:14 ` pinskia at gcc dot gnu dot org
2005-09-09 16:52 ` janis at gcc dot gnu dot org
` (16 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-08 20:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-08 20:14 -------
(In reply to comment #12)
> in fold but we don't try to fold 0 == 0 first.
And to confirm this, this is either a DOM or fold bug, fold is not considered recursive, maybe it should
be in this case.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (13 preceding siblings ...)
2005-09-08 20:14 ` pinskia at gcc dot gnu dot org
@ 2005-09-09 16:52 ` janis at gcc dot gnu dot org
2005-09-13 14:05 ` pinskia at gcc dot gnu dot org
` (15 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: janis at gcc dot gnu dot org @ 2005-09-09 16:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From janis at gcc dot gnu dot org 2005-09-09 16:52 -------
The reduced testcase in comment #5 starts failing with this patch from rakdver:
http://gcc.gnu.org/ml/gcc-cvs/2005-05/msg00814.html
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (14 preceding siblings ...)
2005-09-09 16:52 ` janis at gcc dot gnu dot org
@ 2005-09-13 14:05 ` pinskia at gcc dot gnu dot org
2005-09-16 23:34 ` pinskia at gcc dot gnu dot org
` (14 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-13 14:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-13 14:05 -------
*** Bug 23858 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (15 preceding siblings ...)
2005-09-13 14:05 ` pinskia at gcc dot gnu dot org
@ 2005-09-16 23:34 ` pinskia at gcc dot gnu dot org
2005-09-17 14:24 ` drab at kepler dot fjfi dot cvut dot cz
` (13 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-16 23:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-16 23:34 -------
I have a patch.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (16 preceding siblings ...)
2005-09-16 23:34 ` pinskia at gcc dot gnu dot org
@ 2005-09-17 14:24 ` drab at kepler dot fjfi dot cvut dot cz
2005-09-17 14:53 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: drab at kepler dot fjfi dot cvut dot cz @ 2005-09-17 14:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drab at kepler dot fjfi dot cvut dot cz 2005-09-17 14:24 -------
(In reply to comment #16)
> I have a patch.
Excellent! Where is it?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (17 preceding siblings ...)
2005-09-17 14:24 ` drab at kepler dot fjfi dot cvut dot cz
@ 2005-09-17 14:53 ` pinskia at gcc dot gnu dot org
2005-09-17 14:54 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-17 14:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-17 14:53 -------
Here is the patch:
Index: fold-const.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.625
diff -u -p -r1.625 fold-const.c
--- fold-const.c 9 Sep 2005 09:00:33 -0000 1.625
+++ fold-const.c 17 Sep 2005 14:53:00 -0000
@@ -9953,6 +9953,8 @@ fold_ternary (enum tree_code code, tree
return NULL_TREE;
case COND_EXPR:
+ /* Fold the condition operand, just in case it needs to be foldded. */
+ arg0 = fold (arg0);
/* Pedantic ANSI C says that a conditional expression is never an lvalue,
so all simple results must be passed through pedantic_non_lvalue. */
if (TREE_CODE (arg0) == INTEGER_CST)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (18 preceding siblings ...)
2005-09-17 14:53 ` pinskia at gcc dot gnu dot org
@ 2005-09-17 14:54 ` pinskia at gcc dot gnu dot org
2005-09-17 19:31 ` rguenth at tat dot physik dot uni-tuebingen dot de
` (10 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-17 14:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-17 14:54 -------
I should note I need to test it still which is why I had not posted it yet.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (19 preceding siblings ...)
2005-09-17 14:54 ` pinskia at gcc dot gnu dot org
@ 2005-09-17 19:31 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-09-17 19:38 ` pinskia at physics dot uc dot edu
` (9 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-09-17 19:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-09-17 19:31 -------
Please fix the caller who is not folding the condition in the first place instead.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (20 preceding siblings ...)
2005-09-17 19:31 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-09-17 19:38 ` pinskia at physics dot uc dot edu
2005-09-17 23:09 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-09-17 19:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at physics dot uc dot edu 2005-09-17 19:38 -------
Subject: Re: [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
>
>
> ------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-09-17 19:31 -------
> Please fix the caller who is not folding the condition in the first place instead.
we have "a = b == 0 ? 1 : 2;" before in DOM and then we replace b with the value that DOM thinks is correct and then we have "0 == 0 ? 1 : 2;" which is then passed to fold
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (21 preceding siblings ...)
2005-09-17 19:38 ` pinskia at physics dot uc dot edu
@ 2005-09-17 23:09 ` pinskia at gcc dot gnu dot org
2005-09-17 23:19 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-17 23:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-17 23:09 -------
I am not going to fix a DOM bug.
See http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01084.html for more discussion about this bug.
Though I wonder if I would not hit this bug in my tree combiner but I will handle that when I get there.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (22 preceding siblings ...)
2005-09-17 23:09 ` pinskia at gcc dot gnu dot org
@ 2005-09-17 23:19 ` pinskia at gcc dot gnu dot org
2005-09-17 23:53 ` steven at gcc dot gnu dot org
` (6 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-17 23:19 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |23936
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (23 preceding siblings ...)
2005-09-17 23:19 ` pinskia at gcc dot gnu dot org
@ 2005-09-17 23:53 ` steven at gcc dot gnu dot org
2005-09-18 0:37 ` law at redhat dot com
` (5 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-09-17 23:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-09-17 23:53 -------
It is hardly a DOM bug. More an oversight. Probably easily fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |steven at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-07-24 15:37:30 |2005-09-17 23:53:02
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (24 preceding siblings ...)
2005-09-17 23:53 ` steven at gcc dot gnu dot org
@ 2005-09-18 0:37 ` law at redhat dot com
2005-09-18 10:41 ` steven at gcc dot gnu dot org
` (4 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: law at redhat dot com @ 2005-09-18 0:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2005-09-18 00:37 -------
Subject: Re: [4.1 Regression] ICE with -O3
-ftree-vectorize on 4.1.x
On Sat, 2005-09-17 at 19:38 +0000, pinskia at physics dot uc dot edu
wrote:
> > ------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-09-17 19:31 -------
> > Please fix the caller who is not folding the condition in the first place instead.
>
> we have "a = b == 0 ? 1 : 2;" before in DOM and then we replace b with
> the value that DOM thinks is correct and then we have "0 == 0 ? 1 : 2;" which is then
> passed to fold
Is there some reason fold_stmt (which should have been called after the
replacement by DOM) didn't fold the conditional?
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (25 preceding siblings ...)
2005-09-18 0:37 ` law at redhat dot com
@ 2005-09-18 10:41 ` steven at gcc dot gnu dot org
2005-09-18 15:11 ` steven at gcc dot gnu dot org
` (3 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-09-18 10:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-09-18 10:41 -------
Re. comment #24 -- I guess Devang didn't update fold_stmt and similar
functions for the (still undocumented) modification to GIMPLE to make
<MODIFY_EXPR <LHS> <COND_EXPR <COND> <RHS1> <RHS2>>> valid.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (26 preceding siblings ...)
2005-09-18 10:41 ` steven at gcc dot gnu dot org
@ 2005-09-18 15:11 ` steven at gcc dot gnu dot org
2005-09-18 15:59 ` steven at gcc dot gnu dot org
` (2 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-09-18 15:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-09-18 15:11 -------
Smaller test case:
static unsigned short int crc_table[256];
void AC3_encode_init(void)
{
unsigned int c, n;
for (n = 0; n < 256; n++)
{
c = n << 8;
if (c & 16384)
c = c ^ 49155;
crc_table[n] = c;
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (27 preceding siblings ...)
2005-09-18 15:11 ` steven at gcc dot gnu dot org
@ 2005-09-18 15:59 ` steven at gcc dot gnu dot org
2005-09-20 15:12 ` law at redhat dot com
2005-09-26 13:20 ` pinskia at gcc dot gnu dot org
30 siblings, 0 replies; 32+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-09-18 15:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-09-18 15:59 -------
Actually fold_stmt has nothing to do with it. It is fold (cached_lhs) in
trhead_across_edge that is the problem here. Jeff, what do you think about
this patch?
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.127
diff -u -3 -p -r2.127 tree-ssa-dom.c
--- tree-ssa-dom.c 2 Aug 2005 00:12:39 -0000 2.127
+++ tree-ssa-dom.c 18 Sep 2005 15:57:22 -0000
@@ -701,7 +701,7 @@ thread_across_edge (struct dom_walk_data
else
{
/* Copy the operands. */
- tree *copy;
+ tree *copy, prefold_lhs;
ssa_op_iter iter;
use_operand_p use_p;
unsigned int num, i = 0;
@@ -725,12 +725,33 @@ thread_across_edge (struct dom_walk_data
/* Try to fold/lookup the new expression. Inserting the
expression into the hash table is unlikely to help
- simplify anything later, so just query the hashtable. */
- cached_lhs = fold (TREE_OPERAND (stmt, 1));
- if (TREE_CODE (cached_lhs) != SSA_NAME
- && !is_gimple_min_invariant (cached_lhs))
- cached_lhs = lookup_avail_expr (stmt, false);
+ simplify anything later, so just query the hashtable.
+ Sadly, we have to handle conditional assignments specially
+ here, because fold expects all the operands of an expression
+ to be folded before the expression itself is folded, but we
+ can't just substitute the folded condition here. */
+ if (TREE_CODE (TREE_OPERAND (stmt, 1)) == COND_EXPR)
+ {
+ tree cond = COND_EXPR_COND (TREE_OPERAND (stmt, 1));
+ cond = fold (cond);
+ if (cond == boolean_true_node)
+ prefold_lhs = COND_EXPR_THEN (TREE_OPERAND (stmt, 1));
+ else if (cond == boolean_false_node)
+ prefold_lhs = COND_EXPR_ELSE (TREE_OPERAND (stmt, 1));
+ else
+ prefold_lhs = NULL;
+ }
+ else
+ prefold_lhs = TREE_OPERAND (stmt, 1);
+
+ if (prefold_lhs)
+ {
+ cached_lhs = fold (prefold_lhs);
+ if (TREE_CODE (cached_lhs) != SSA_NAME
+ && !is_gimple_min_invariant (cached_lhs))
+ cached_lhs = lookup_avail_expr (stmt, false);
+ }
/* Restore the statement's original uses/defs. */
i = 0;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (28 preceding siblings ...)
2005-09-18 15:59 ` steven at gcc dot gnu dot org
@ 2005-09-20 15:12 ` law at redhat dot com
2005-09-26 13:20 ` pinskia at gcc dot gnu dot org
30 siblings, 0 replies; 32+ messages in thread
From: law at redhat dot com @ 2005-09-20 15:12 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2005-09-20 15:11 -------
Subject: Re: [4.1 Regression] ICE with -O3
-ftree-vectorize on 4.1.x
On Sun, 2005-09-18 at 15:59 +0000, steven at gcc dot gnu dot org wrote:
> ------- Additional Comments From steven at gcc dot gnu dot org 2005-09-18 15:59 -------
> Actually fold_stmt has nothing to do with it. It is fold (cached_lhs) in
> trhead_across_edge that is the problem here. Jeff, what do you think about
> this patch?
Presumably COND_EXPR on the RHS of a statement is the only special case
that we need to worry about. I can't immediately think of others.
Seems pretty reasonable, in the case were the COND_EXPR_COND does not
fold, you could safely set pre_fold_lhs to TREE_OPERAND (stmt, 1) which
would allow us to catch cases where the THEN/ELSE clauses of the
COND_EXPR are equivalent due to substitutions. But I doubt it's
terribly important.
You might use pre_fold_expr rather than pre_fold_lhs which is a little
confusing since we're looking at the RHS of a statement :-)
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
` (29 preceding siblings ...)
2005-09-20 15:12 ` law at redhat dot com
@ 2005-09-26 13:20 ` pinskia at gcc dot gnu dot org
30 siblings, 0 replies; 32+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-26 13:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-26 13:20 -------
This is also testsuite/gcc.c-torture/execute/builtin-bitops-1.c failure with "-ftree-vectorize -maltivec"
on powerpc-darwin, see
http://gcc.gnu.org/ml/gcc-testresults/2005-09/msg01199.html
http://gcc.gnu.org/ml/gcc-testresults/2005-09/msg01201.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2005-09-26 13:20 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-24 14:23 [Bug tree-optimization/23049] New: ICE with -O3 -ftree-vectorize on 4.1.x drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:24 ` [Bug tree-optimization/23049] " drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:32 ` drab at kepler dot fjfi dot cvut dot cz
2005-07-24 14:35 ` drab at kepler dot fjfi dot cvut dot cz
2005-07-24 15:06 ` pinskia at gcc dot gnu dot org
2005-07-24 15:37 ` [Bug tree-optimization/23049] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-07-24 15:41 ` pinskia at gcc dot gnu dot org
2005-07-24 15:43 ` pinskia at gcc dot gnu dot org
2005-07-24 15:56 ` belyshev at depni dot sinp dot msu dot ru
2005-07-24 16:01 ` pinskia at gcc dot gnu dot org
2005-07-24 16:15 ` belyshev at depni dot sinp dot msu dot ru
2005-07-27 10:51 ` dorit at il dot ibm dot com
2005-08-01 14:01 ` pinskia at gcc dot gnu dot org
2005-08-03 0:50 ` pinskia at gcc dot gnu dot org
2005-09-08 20:14 ` pinskia at gcc dot gnu dot org
2005-09-09 16:52 ` janis at gcc dot gnu dot org
2005-09-13 14:05 ` pinskia at gcc dot gnu dot org
2005-09-16 23:34 ` pinskia at gcc dot gnu dot org
2005-09-17 14:24 ` drab at kepler dot fjfi dot cvut dot cz
2005-09-17 14:53 ` pinskia at gcc dot gnu dot org
2005-09-17 14:54 ` pinskia at gcc dot gnu dot org
2005-09-17 19:31 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-09-17 19:38 ` pinskia at physics dot uc dot edu
2005-09-17 23:09 ` pinskia at gcc dot gnu dot org
2005-09-17 23:19 ` pinskia at gcc dot gnu dot org
2005-09-17 23:53 ` steven at gcc dot gnu dot org
2005-09-18 0:37 ` law at redhat dot com
2005-09-18 10:41 ` steven at gcc dot gnu dot org
2005-09-18 15:11 ` steven at gcc dot gnu dot org
2005-09-18 15:59 ` steven at gcc dot gnu dot org
2005-09-20 15:12 ` law at redhat dot com
2005-09-26 13:20 ` 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).