Bug 9167 - [3.3/3.4 regression] ICE in simplify_gen_subreg with optimization
Summary: [3.3/3.4 regression] ICE in simplify_gen_subreg with optimization
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-01-03 17:36 UTC by Peter Schmid
Modified: 2004-01-17 04:22 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Schmid 2003-01-03 17:36:01 UTC
Optimization, -O or more, breaks the following simple source code. The
code compiles normally, when the constructor and the destructor
definitions are removed. This a regression with respect to previous
gcc snapshots.

Release:
3.4 20021231 (experimental)

Environment:
System: Linux kiste 2.4.18 #10 Thu Dec 26 00:47:26 CET 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with:

How-To-Repeat:
source code tc.C
class A {
private:
	const int n;
public:
	A(const int n_) : n(n_) { }
	A(const A& x) : n(x.n) { }
	~A() { }
	A operator^(A) const {
		A result(n);
		return result;
	}
	A& operator=(const A) {
		return *this;
	}

};


void f(void)
{
  A a_1(16);
  a_1 = a_1 ^ a_1;
}


Compiling tc.C
with optimization
g++ -O -v -W -Wall tc.C
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: 
Thread model: posix
gcc version 3.4 20021231 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=4 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE tc.C -D__GNUG__=3 -quiet -dumpbase tc.C -auxbase tc -O -W -Wall -version -o /tmp/ccVohn8F.s
GNU C++ version 3.4 20021231 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.4 20021231 (experimental).
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/c++/3.4
 /usr/local/include/c++/3.4/i686-pc-linux-gnu
 /usr/local/include/c++/3.4/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
tc.C: In function `void f()':
tc.C:8: internal compiler error: in simplify_gen_subreg, at simplify-rtx.c:2629
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


without optimization
g++ -v -W -Wall tc.C
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: 
Thread model: posix
gcc version 3.4 20021231 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=4 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE tc.C -D__GNUG__=3 -quiet -dumpbase tc.C -auxbase tc -W -Wall -version -o /tmp/ccCN4wKN.s
GNU C++ version 3.4 20021231 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.4 20021231 (experimental).
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/c++/3.4
 /usr/local/include/c++/3.4/i686-pc-linux-gnu
 /usr/local/include/c++/3.4/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccg9UB1y.o /tmp/ccCN4wKN.s
GNU assembler version 2.13.90.0.4 (i686-pc-linux-gnu) using BFD version 2.13.90.0.4 20020814
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/../../../../i686-pc-linux-gnu/lib -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/../../.. /tmp/ccg9UB1y.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/crtend.o /usr/lib/crtn.o
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status

Compilation exited abnormally with code 1 at Sat Jan  4 02:33:24
Comment 1 Wolfgang Bangerth 2003-01-03 17:57:44 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. It is a regression from gcc3.2.2pre. My
    compiler collection tells me that the regression was
    introduced between 2002-12-04 and 2002-12-05.
    
    W.
Comment 2 janis187 2003-01-06 14:41:31 UTC
From: Janis Johnson <janis187@us.ibm.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
   nobody@gcc.gnu.org, schmid@snake.iap.physik.tu-darmstadt.de
Cc:  
Subject: Re: c++/9167: [3.3/3.4 regression] ICE in simplify_gen_subreg with 
 optimization
Date: Mon, 06 Jan 2003 14:41:31 -0800

 The regression showed up with this patch:
 
 2002-12-04  Jason Merrill  <jason@redhat.com>
 
         PR c++/8461, c++/8625
         * integrate.c (copy_decl_for_inlining): Handle explicit
 invisible
         references.
         * tree-inline.c (initialize_inlined_parameters): Likewise.
 
         * tree.c (variably_modified_type_p): Just return an
 error_mark_node.
 
 cp/:
         PR c++/8674
         * call.c (build_over_call): Check specifically for TARGET_EXPR
         when eliding.
 
         PR c++/8461, c++/8625
         * call.c (convert_for_arg_passing): Don't mess with
 error_mark_node.
         (cp_convert_parm_for_inlining): Remove.
         * cp-lang.c
 (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
         Remove.
         * cp-tree.h (ADDR_IS_INVISIREF): Remove.
         * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF
 code.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9167
 
 
 

Comment 3 Jason Merrill 2003-01-17 23:59:11 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9167
Date: 17 Jan 2003 23:59:11 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jason@gcc.gnu.org	2003-01-17 15:59:11
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 
 Log message:
 	PR c++/9167, c++/9358
 	* decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3166&r2=1.3167
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.990&r2=1.991
 

Comment 4 Jason Merrill 2003-01-17 23:59:23 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9167
Date: 17 Jan 2003 23:59:23 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jason@gcc.gnu.org	2003-01-17 15:59:23
 
 Added files:
 	gcc/testsuite/g++.dg/init: inline1.C 
 
 Log message:
 	PR c++/9167, c++/9358
 	* decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/inline1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 5 Jason Merrill 2003-01-18 01:11:03 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9167
Date: 18 Jan 2003 01:11:03 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	jason@gcc.gnu.org	2003-01-17 17:11:03
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 
 Log message:
 	PR c++/9167, c++/9358
 	* decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.19&r2=1.3076.2.20
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.5&r2=1.965.2.6
 
Comment 6 Paolo Carlini 2003-01-18 06:40:04 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3 and 3.4.