Bug 20023 - [4.0 Regression] internal compiler error: Segmentation fault
Summary: [4.0 Regression] internal compiler error: Segmentation fault
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
Keywords: ice-on-valid-code
Depends on:
Reported: 2005-02-17 08:54 UTC by Caolan McNamara
Modified: 2005-02-18 00:22 UTC (History)
3 users (show)

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

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

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/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
/usr/src/redhat/BUILD/SRC680_m77/sw/source/ui/dbui/mmoutputpage.cxx: In member
function \uffff\uffff\ufffflong int
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:

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.


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