Bug 4490 - ICE with -m128bit-long-double
Summary: ICE with -m128bit-long-double
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.0.1
: P3 normal
Target Milestone: 3.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 5894 8426 10137 10487 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-06 03:46 UTC by georg
Modified: 2003-12-10 04:25 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
pack_isam.i.bz2 (40.04 KB, application/octet-stream)
2003-05-21 15:17 UTC, georg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description georg 2001-10-06 03:46:02 UTC
i tried to compile mysql with a lot of optimizations for pentiums (as far as i recognised in the gcc-manual).
With that optimizations gcc segfaults as it compiles pack_isam.c.

The command was:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include  -save-temps -O3 -DDBUG_OFF -O3 -ffast-math -funroll-loops -march=i686 -malign-double -m128bit-long-double -maccumulate-outgoing-args -momit-leaf-frame-pointer -fomit-frame-pointer  -c pack_isam.c

The compiler output was:
pack_isam.c: In function `compress':
pack_isam.c:646: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

Release:
3.0.1 (maybe in earlier versions too)

Environment:
i686-pc-linux-gnu / kernel 2.4.10 / SuSE 7.0 / glibc 2.1
Comment 1 georg 2001-10-06 03:46:02 UTC
Fix:
the file compiled proberbly when i don't use -m128bit-long-double
Comment 2 Volker Reichelt 2001-10-08 15:37:49 UTC
From: Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, georg@steffers.org
Cc:  
Subject: Re: optimization/4490
Date: Mon, 8 Oct 2001 15:37:49 +0200

 Hi,
 
 the problem can be reduced to the following testcase:
 
 void f()
 {
   unsigned long long ull;
   double d=ull;
 }
 
 I get a seg-fault when I try to compile this with
   "gcc -m128bit-long-double -c <filename>"
 using gcc 3.0 on an i686-pc-linux-gnu.
 The problem seems to be the cast from "unsigned long long"
 to "double" with "-m128bit-long-double" enabled
 (so it's probably not an optimization issue).
 
 In the original testcase this leads into trouble with the last
 "printf" statement in the function "compress".
 
 Greetings,
 Volker Reichelt
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4490&database=gcc
 
 
Comment 3 Craig Rodrigues 2001-12-01 18:06:18 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Reproduced error from Volker's simplified testcase.
    Error occurred in gcc 3.1 and gcc 3.0 branches.
    
    Running cc1plus in the debugger results in:
    
    Program received signal SIGSEGV, Segmentation fault.
    0x08229906 in ix86_constant_alignment (exp=0x40177dc0, align=32)
        at config/i386/i386.c:10601
    10601         if (TYPE_MODE (TREE_TYPE (exp)) == DFmode && align < 64)
    
    where exp is NULL.
Comment 4 Craig Rodrigues 2001-12-02 02:06:19 UTC
From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  georg@steffers.org, nobody@gcc.gnu.org, reichelt@igpm.rwth-aachen.de
Cc:  
Subject: Re: optimization/4490: gcc 3.0.1 segfaults while compiling pack_isam.c of mysql
Date: 2 Dec 2001 02:06:19 -0000

 Synopsis: gcc 3.0.1 segfaults while compiling pack_isam.c of mysql
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: rodrigc
 State-Changed-When: Sat Dec  1 18:06:18 2001
 State-Changed-Why:
     Reproduced error from Volker's simplified testcase.
     Error occurred in gcc 3.1 and gcc 3.0 branches.
     
     Running cc1plus in the debugger results in:
     
     Program received signal SIGSEGV, Segmentation fault.
     0x08229906 in ix86_constant_alignment (exp=0x40177dc0, align=32)
         at config/i386/i386.c:10601
     10601         if (TYPE_MODE (TREE_TYPE (exp)) == DFmode && align < 64)
     
     where exp is NULL.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4490&database=gcc
Comment 5 Richard Henderson 2002-04-03 01:02:02 UTC
State-Changed-From-To: analyzed->suspended
State-Changed-Why: The problem is that the front-end isn't told about the 128-bit
    type, so type_for_mode returns NULL.
    
    -m128bit-long-double really needs to be using TFmode within
    the compiler, rather than playing games with XFmode.
Comment 6 Wolfgang Bangerth 2003-04-24 19:40:19 UTC
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: optimization/4490
Date: Thu, 24 Apr 2003 19:40:19 -0500 (CDT)

 This can be reproduced still with today's 3.3 and 3.4 branches.
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 

Comment 7 Wolfgang Bangerth 2003-04-24 19:43:29 UTC
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: rth@gnu.gcc.org
Cc: gcc-gnats@gcc.gnu.org
Subject: optimization/4490
Date: Thu, 24 Apr 2003 19:43:29 -0500 (CDT)

 Richard,
 I just closed a report for which I found that it is a duplicate of 4490. 
 What startles me with that one is that it is suspended. What is the reason 
 for that? If this just waits for someone to fix it, I think we'd better 
 leave it analyzed. "suspended" only seems like the proper choice when we 
 are waiting for external events to happen (resolution of a standard defect 
 report, branch to merge, etc).
 
 Thanks
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 

Comment 8 Richard Henderson 2003-04-24 20:31:41 UTC
From: Richard Henderson <rth@redhat.com>
To: Wolfgang Bangerth <bangerth@ices.utexas.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/4490
Date: Thu, 24 Apr 2003 20:31:41 -0700

 On Thu, Apr 24, 2003 at 07:43:29PM -0500, Wolfgang Bangerth wrote:
 > What startles me with that one is that it is suspended. What is the reason 
 > for that?
 
 I use "suspended" for things we acknowledge are bugs, but
 have no plans to ever fix.
 
 
 r~

Comment 9 Wolfgang Bangerth 2003-04-25 10:18:59 UTC
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: Richard Henderson <rth@redhat.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/4490
Date: Fri, 25 Apr 2003 10:18:59 -0500 (CDT)

 > > What startles me with that one is that it is suspended. What is the reason 
 > > for that?
 > 
 > I use "suspended" for things we acknowledge are bugs, but
 > have no plans to ever fix.
 
 I'm not sure whether I like the approach, but I see that it's consistent 
 with our guidelines. For similar cases: can you leave a note in the audit 
 trail of this "no plans to fix" when you suspend a PR? 
 
 Thanks for the clarification! 
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
Comment 10 Jim Wilson 2003-06-02 23:34:22 UTC
It appears that this can be fixed by changing all of the XFmode patterns with
!TARGET_64BIT in the condition to instead use !TARGET_128BIT_LONG_DOUBLE in the
condition.
Comment 11 Jim Wilson 2003-06-06 04:44:00 UTC
I installed a patch from Kelley Cook that does what I suggested, and which makes
both the minimal testcase work and the original pack_isam.i testcase work.  This
can probably closed now.
Comment 12 Wolfgang Bangerth 2003-06-06 16:49:49 UTC
Jim Wilson installed a patch for this.
Comment 13 GCC Commits 2003-07-19 13:56:09 UTC
Subject: Bug 4490

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	kcook@gcc.gnu.org	2003-07-19 13:56:01

Modified files:
	gcc            : ChangeLog 
	gcc/doc        : invoke.texi 

Log message:
	PR optimization/4490
	* doc/invoke.texi (m96bit-long-double, m128bit-long-double):  Reword
	documentation to accurately reflect what these options do.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.673&r2=1.16114.2.674
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.209.2.41&r2=1.209.2.42

Comment 14 GCC Commits 2003-12-10 04:22:56 UTC
Subject: Bug 4490

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	kcook@gcc.gnu.org	2003-12-10 04:22:52

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.md 

Log message:
	2003-12-09  Kelley Cook  <kelleycook@wideopenwest.com>
	
	2003-06-04  Kelley Cook  <kelleycook@wideopenwest.com>
	PR optimization/4490
	* config/i386/i386.md: Don't use XFMode if TARGET_128BIT_LONG_DOUBLE.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.832&r2=1.16114.2.833
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.404.2.20&r2=1.404.2.21