Bug 33540 - [4.2 regression] ICE with vectors in expand_simple_binop at optabs.c
Summary: [4.2 regression] ICE with vectors in expand_simple_binop at optabs.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-09-24 00:43 UTC by ebuddington
Modified: 2009-03-30 22:27 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 4.1.2 4.3.0
Known to fail: 4.2.0 4.2.1 4.2.2 4.2.5
Last reconfirmed: 2007-12-27 18:48:49


Attachments
error-producing test case (92.61 KB, text/plain)
2007-09-24 00:52 UTC, ebuddington
Details
output of 'g++ -Wall -O3 -march=native -v -c test.cc' (747 bytes, text/plain)
2007-09-24 11:24 UTC, ebuddington
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ebuddington 2007-09-24 00:43:01 UTC
The error-producing command line is

g++ -Wall -O3 -march=native -c videospeed.cc

videospeed.cc: In function 'int main(int, char**)':
videospeed.cc:275: internal compiler error: in expand_simple_binop, at optabs.c:1158


Adding -save-temps gives a new warning "SSE instruction set disabled, using 387 arithmetics", and the compile succeeds. Also, changing to -march=i386 or -march=i686 avoids the problem.

I will attach the g++ -E output, which does trigger the error.
Comment 1 ebuddington 2007-09-24 00:52:12 UTC
Created attachment 14247 [details]
error-producing test case

test case: rename to test.cc, and 'g++ -Wall -O3 -march=native -c test.cc'
Comment 2 Andrew Pinski 2007-09-24 02:12:49 UTC
Can you provide the -v output?  This is needed if you use -march=native.
Comment 3 ebuddington 2007-09-24 02:39:57 UTC
bash-2.05b$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2.1/configure --prefix=/packages/gcc/4.2.1/any --exec-prefix=/packages/gcc/4.2.1/i386
Thread model: posix
gcc version 4.2.1
Comment 4 Richard Biener 2007-09-24 08:36:14 UTC
-v output when compiling, that is,

g++ -Wall -O3 -march=native -c videospeed.cc -v
Comment 5 ebuddington 2007-09-24 11:24:51 UTC
Created attachment 14249 [details]
output of 'g++ -Wall -O3 -march=native -v -c test.cc'
Comment 6 Volker Reichelt 2007-12-27 18:48:48 UTC
Confirmed. Reduced testcase that crashes on i686-pc-linux-gnu when compiled
with "-msse -O" (as C or C++ code):

======================================================
typedef int v4i __attribute__((vector_size(16)));

void foo(v4i* p, v4i v)
{
  int i;
  for (i=0; i < 4; ++i)
    *p += v;
}
======================================================

bug.c: In function 'foo':
bug.c:8: internal compiler error: in expand_simple_binop, at optabs.c:1157
Please submit a full bug report, [etc.]

The bug appeared in GCC 4.2.0 and disappeared on mainline between
2007-09-14 and 2007-10-13.
Comment 7 Joseph S. Myers 2008-02-01 16:54:48 UTC
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Comment 8 Joseph S. Myers 2008-05-19 20:23:26 UTC
4.2.4 is being released, changing milestones to 4.2.5.
Comment 9 Joseph S. Myers 2009-03-30 22:27:27 UTC
Closing 4.2 branch, fixed in 4.3.