GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.
Bug 20023 - [4.0 Regression] internal compiler error: Segmentation fault
Summary: [4.0 Regression] internal compiler error: Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 critical
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-02-17 08:54 UTC by Caolan McNamara
Modified: 2005-02-18 00:22 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-02-17 14:05:42


Attachments
bzip2 compressed proprocessed dump (348.64 KB, application/x-bzip)
2005-02-17 08:55 UTC, Caolan McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Caolan McNamara 2005-02-17 08:54:10 UTC
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --with-gxx-include-dir=/usr/include/c++/3.4.3
--enable-languages=c,c++,java,f95 --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.0 20050216 (Red Hat 4.0.0-0.24)

---

------------------------------
Making: ../../../unxlngi6.pro/slo/mmoutputpage.obj
g++4 -Wreturn-type -fmessage-length=0 -c -I.  -I. -I../inc -I../../../inc
-I../../../unx/inc -I../../../unxlngi6.pro/inc -I.
-I/usr/src/redhat/BUILD/SRC680_m77/solver/680/unxlngi6.pro/inc/stl
-I/usr/src/redhat/BUILD/SRC680_m77/solver/680/unxlngi6.pro/inc/external
-I/usr/src/redhat/BUILD/SRC680_m77/solver/680/unxlngi6.pro/inc
-I/usr/src/redhat/BUILD/SRC680_m77/solenv/unxlngi6/inc
-I/usr/src/redhat/BUILD/SRC680_m77/solenv/inc
-I/usr/src/redhat/BUILD/SRC680_m77/res
-I/usr/src/redhat/BUILD/SRC680_m77/solver/680/unxlngi6.pro/inc/stl
-I/usr/src/redhat/BUILD/SRC680_m77/solenv/inc/Xp31 -I/usr/include
-I/usr/X11R6/include     -I. -I../../../res -I. -Wuninitialized -g1 -Os
-fno-strict-aliasing   -fvisibility=hidden -pipe -mtune=pentiumpro
-Wno-ctor-dtor-privacy -fexceptions -fno-enforce-eh-specs   -fpic -DLINUX -DUNX
-DVCL -DGCC -DC341 -DINTEL -DGXX_INCLUDE_PATH=/usr/include/c++/3.4.3 -DCVER=C341
-D_USE_NAMESPACE -DGLIBC=2 -DX86 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR
-D_USE_NAMESPACE=1 -DSTLPORT_VERSION=400 -DHAVE_GCC_VISIBILITY_FEATURE -D__DMAKE
-DUNIX -DCPPU_ENV=gcc3 -DSUPD=680 -DPRODUCT -DNDEBUG -DPRODUCT_FULL
-DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA -DSRC680  
-DNUM_RELSPACE -DVERTICAL_LAYOUT -DACCESSIBLE_LAYOUT -DBIDI
-DSW_DLLIMPLEMENTATION -DSHAREDLIB -D_DLL_  -DMULTITHREAD  -o
../../../unxlngi6.pro/slo/mmoutputpage.o
/usr/src/redhat/BUILD/SRC680_m77/sw/source/ui/dbui/mmoutputpage.cxx
/usr/src/redhat/BUILD/SRC680_m77/sw/source/ui/dbui/mmoutputpage.cxx: In member
function \uffff\uffff\ufffflong int
SwMailMergeOutputPage::SendDocumentsHdl_Impl(PushButton*)\uffff\uffff\uffff:
/usr/src/redhat/BUILD/SRC680_m77/sw/source/ui/dbui/mmoutputpage.cxx:1075:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Preprocessed source stored into /tmp/ccmwCH46.out file, please attach this to
your bugreport.
dmake:  Error code 1, while making '../../../unxlngi6.pro/slo/mmoutputpage.obj'
'---* tg_merge.mk *---'
dmake:  Error code 255, while making 'do_it_exceptions'
'---* tg_merge.mk *---'
Comment 1 Caolan McNamara 2005-02-17 08:55:12 UTC
Created attachment 8212 [details]
bzip2 compressed proprocessed dump
Comment 2 Andrew Pinski 2005-02-17 13:15:06 UTC
Hmm, I cannot reproduce this with 4.0.0 20050215 on i686-pc-linux-gnu, so either this is new as of 
yesterday or it was just a fluk.  I am thinking the former.
Comment 3 Andrew Pinski 2005-02-17 13:59:44 UTC
It was the former, it regressed from the last two days, reducing.
Comment 4 Jakub Jelinek 2005-02-17 14:04:00 UTC
Oops, started reducing it a couple of minutes already.
Comment 5 Andrew Pinski 2005-02-17 14:05:42 UTC
Reduced testcase:
void f(void);
typedef __SIZE_TYPE__ size_t;
void g(void *a)
{
  size_t b = (size_t)a;
  switch (b)
  {
    case 1:
      f();
    break;
  }
}

This looks very much related to PR 20009 as I think it was caused by the same patch.
Comment 6 Jakub Jelinek 2005-02-17 14:34:32 UTC
Yeah, it is caused by that part of my patch.
The result of convert_to_integer is in one case
<nop_expr (size_t) <convert_expr (unsigned int) <param_decl (pointer) >>>
and without that part of the patch:
<nop_expr (size_t) <convert_expr (int) <param_decl (pointer) >>>
But fold folds the former into <nop_expr (size_t) <param_decl (pointer) >>
while in the latter case fold does nothing with it.
And expand_case is not prepared to deal with POINTER_TYPE's in SWITCH_COND.

Anyway, as already the other part of the PR middle-end/19857 fix is sufficient
to fix the bug, I'm leaning towards reverting the convert.c (convert_to_integer)
part of the patch and give it a shot after 4.0 branches.
Comment 7 CVS Commits 2005-02-17 23:57:05 UTC
Subject: Bug 20023

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-02-17 23:56:55

Modified files:
	gcc            : ChangeLog convert.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.c-torture/compile: 20050217-1.c 
	gcc/testsuite/g++.dg/opt: switch3.C 

Log message:
	PR c++/20023
	PR tree-optimization/20009
	* convert.c (convert_to_integer): Revert 2005-02-16 change.
	
	* gcc.c-torture/compile/20050217-1.c: New test.
	* g++.dg/opt/switch3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7518&r2=2.7519
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/convert.c.diff?cvsroot=gcc&r1=1.56&r2=1.57
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5045&r2=1.5046
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20050217-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/switch3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 8 Andrew Pinski 2005-02-18 00:22:49 UTC
Fixed.