public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36105]  New: GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message
@ 2008-05-02  0:20 akalten at comcast dot net
  2008-05-02  0:23 ` [Bug target/36105] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: akalten at comcast dot net @ 2008-05-02  0:20 UTC (permalink / raw)
  To: gcc-bugs

Code that compiled and executed without problem using previous
versions of gcc, up to gcc-4.2.3, now crashes with an "Ilegal
Instruction" message.  An example of such code is given in
the following short program.

double table[128];
int main()
{
int i;
for(i = 0; i < 128; i++)
table[i] = (i * i) / 127.0;
return 0;
}

Compiling this code with gcc-4.3.0 using CFLAGS='-m64 -O3 -pipe -march=core2
-mfpmath=sse -msse4.1 -m128bit-long-double -ffast-math -Wall' will produce
a program that immediately halts with an "Illegal Instruction" message.
Previous versions of gcc using the same optimization did not cause this to
happen.

The compiler produces no output or warnings.

If the CFLAGS variable includes "-O2" instead of "-O3" the problem
disappears.  The above code will compile and execute without crashing
and producing the "Illegal Instruction" message.

The system is Gnu/Linux with Intel Core 2 (x86_64-unknown-linux-gnu).

Here is the output of gcc -v:

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-threads
--enable-threads=posix --disable-nls --enable-languages=c,c++,fortran
--disable-multilib --enable-decimal-float --with-long-double-128
Thread model: posix
gcc version 4.3.0 (GCC)

Andrew Kalten


-- 
           Summary: GCC-4.3.0 Optimized Code Fails With "Illegal
                    Instruction" Message
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: akalten at comcast dot net
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36105


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/36105] GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message
  2008-05-02  0:20 [Bug c/36105] New: GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message akalten at comcast dot net
@ 2008-05-02  0:23 ` pinskia at gcc dot gnu dot org
  2008-05-02  0:50 ` akalten at comcast dot net
  2008-05-02  3:37 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-02  0:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-05-02 00:22 -------
Are you sue you have a processor with "sse4.1" support in it?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36105


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/36105] GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message
  2008-05-02  0:20 [Bug c/36105] New: GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message akalten at comcast dot net
  2008-05-02  0:23 ` [Bug target/36105] " pinskia at gcc dot gnu dot org
@ 2008-05-02  0:50 ` akalten at comcast dot net
  2008-05-02  3:37 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: akalten at comcast dot net @ 2008-05-02  0:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from akalten at comcast dot net  2008-05-02 00:49 -------
The processor is a Core 2 Quad 6600.  I thought all Core 2 Quads
had sse4 but only the Q9000 series has it.  The Q6600 has sse3.

So in this case the command flags are incorrect.  Using "-msse3"
fixes the issue.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36105


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/36105] GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message
  2008-05-02  0:20 [Bug c/36105] New: GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message akalten at comcast dot net
  2008-05-02  0:23 ` [Bug target/36105] " pinskia at gcc dot gnu dot org
  2008-05-02  0:50 ` akalten at comcast dot net
@ 2008-05-02  3:37 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-02  3:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-05-02 03:36 -------
As mentioned, the user did not have the hardware he was trying to compile for.

By the way you might want to give -march=native a try.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36105


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-02  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-02  0:20 [Bug c/36105] New: GCC-4.3.0 Optimized Code Fails With "Illegal Instruction" Message akalten at comcast dot net
2008-05-02  0:23 ` [Bug target/36105] " pinskia at gcc dot gnu dot org
2008-05-02  0:50 ` akalten at comcast dot net
2008-05-02  3:37 ` 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).