Bug 12628 - [3.4 regression] Segfault with -fno-expensive-optimizations -fno-rerun-loop-opt
Summary: [3.4 regression] Segfault with -fno-expensive-optimizations -fno-rerun-loop-opt
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, patch
: 13229 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-15 22:18 UTC by Falk Hueffner
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host: alphaev68-unknown-linux-gnu
Target: alphaev68-unknown-linux-gnu
Build: alphaev68-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-10-18 18:28:53


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Falk Hueffner 2003-10-15 22:18:57 UTC
GNU C version 3.4 20031012 (experimental) (alphaev68-unknown-linux-gnu)

falk@juist:/tmp% cat min2.c    
int outbuf[100];
int outcnt;
int bi_buf;
void send_bits(void)
{
    bi_buf = 0;
    outbuf[outcnt++] = 8;
    outbuf[outcnt++] = 8;
    if (outcnt)
        bi_buf = 1;
}

falk@juist:/tmp% gcc -O2 -c -fno-expensive-optimizations -fno-rerun-loop-opt
min2.c                                          
min2.c: In function `send_bits':                                                 
min2.c:11: 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.

Also happens on tree-ssa.
Comment 1 Andrew Pinski 2003-10-18 18:28:50 UTC
I can confirm this on the mainline (20031017) on powerpc-apple-darwin:

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x000af810 in init_alias_analysis () at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/
src/gcc/alias.c:2842
2842                      else if (REG_N_SETS (regno) == 1
(gdb) bt
#0  0x000af810 in init_alias_analysis () at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-
clean/src/gcc/alias.c:2842
#1  0x000eb840 in bypass_jumps (file=0x0) at /Volumes/UFS_Partition/pinskia/src/fsf/
gcc-clean/src/gcc/gcse.c:7970
#2  0x0009ee78 in rest_of_compilation (decl=0x0) at /Volumes/UFS_Partition/pinskia/
src/fsf/gcc-clean/src/gcc/toplev.c:2560
#3  0x001403b4 in tree_rest_of_compilation (fndecl=0x0, nested_p=false) at /Volumes/
UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/tree-optimize.c:168
#4  0x00018a98 in c_expand_body_1 (fndecl=0x4045f818, nested_p=0) at /Volumes/
UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/c-decl.c:6157
#5  0x0013a22c in cgraph_expand_function (node=0x40bd3ee0) at /Volumes/
UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cgraphunit.c:495
#6  0x0013a990 in cgraph_optimize () at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-
clean/src/gcc/cgraphunit.c:1273
#7  0x00049678 in c_objc_common_finish_file () at /Volumes/UFS_Partition/pinskia/src/
fsf/gcc-clean/src/gcc/c-objc-common.c:244
#8  0x0009d2b0 in toplev_main (argc=1078325600, argv=0x3e73e8) at /Volumes/
UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/toplev.c:1821
#9  0x0000271c in _start (argc=17, argv=0xbffffb7c, envp=0xbffffbc4) at /SourceCache/
Csu/Csu-46/crt.c:267
#10 0x00002590 in start ()
Comment 2 Andrew Pinski 2003-12-01 02:55:05 UTC
*** Bug 13229 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Pinski 2003-12-01 02:55:19 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2003-12/msg00001.html>.
Comment 4 GCC Commits 2003-12-01 21:17:10 UTC
Subject: Bug 12628

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2003-12-01 21:16:59

Modified files:
	gcc            : ChangeLog toplev.c regclass.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: 20031201-1.c 

Log message:
	PR optimization/12628
	* toplev.c (rest_of_handle_jump_bypass): Call reg_scan.
	* regclass.c (reg_scan): Include allocate_reg_info time in
	TV_REG_SCAN.  Minor clean-ups.
	(reg_scan_update): Minor clean-ups.
	
	* gcc.dg/20031201-1.c: New test case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1882&r2=2.1883
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&r1=1.847&r2=1.848
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regclass.c.diff?cvsroot=gcc&r1=1.179&r2=1.180
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3215&r2=1.3216
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20031201-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 Andrew Pinski 2003-12-01 23:07:06 UTC
Fixed for 3.4.