Bug 12712 - [3.3.2/3.4 regression] ICE on short legit C++ code fragment with gcc 3.3.2
Summary: [3.3.2/3.4 regression] ICE on short legit C++ code fragment with gcc 3.3.2
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.2
: P1 critical
Target Milestone: 3.3.3
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-10-21 19:42 UTC by Markus Schoder
Modified: 2004-01-17 04:22 UTC (History)
2 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: 2003-10-21 22:05:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schoder 2003-10-21 19:42:38 UTC
The following valid C++ code gives an ICE with gcc 3.3.2
when no optimization is used. With -O, -O2 or -O3 the code
compiles.

struct A
{
  ~A();
  float f(float x);
  float g() const {return 0;}
};

void h()
{
  A a, b;
  a.f(b.g() + 1);
}
Comment 1 Volker Reichelt 2003-10-21 22:05:36 UTC
Indeed. Crashes 3.3.2 and mainline.
According to Phil's regression checker, the regression was
introduced between 2003-09-21-trunk (#407) and 2003-09-22-trunk (#408).
Comment 2 Eric Botcazou 2003-10-22 04:07:51 UTC
This is

2003-09-22  Olivier Hainque  <hainque@act-europe.fr>

	PR target/9786
	* reg-stack.c (convert_regs_1): Purge possible dead eh edges
	after potential deletion of trapping insn. Avoids later ICE
	from call to fixup_abnormal_edges.
	(convert_regs_2): Stack the current block successors before
	processing this block, that is, before the potential deletion of
	dead edges by convert_regs_1, because these edges have been used
	to initialize the predecessors count.


Since I checked in the patch, I'll investigate.
Comment 3 Eric Botcazou 2003-10-25 12:42:23 UTC
This is really x86-specific.
Comment 4 GCC Commits 2003-10-25 12:55:21 UTC
Subject: Bug 12712

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2003-10-25 12:55:18

Modified files:
	gcc            : ChangeLog reg-stack.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: reg-stack3.C 

Log message:
	PR target/12712
	* reg-stack.c (convert_regs_1): Create an arbitrary input stack
	if the block has no predecessors.
	(convert_regs_2): Document the problem with successors whose
	only predecessor is the block to be processed.
	(convert_regs): Don't create the arbitrary input stack here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1548&r2=2.1549
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reg-stack.c.diff?cvsroot=gcc&r1=1.135&r2=1.136
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3144&r2=1.3145
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/reg-stack3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 GCC Commits 2003-10-25 13:00:45 UTC
Subject: Bug 12712

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2003-10-25 13:00:42

Modified files:
	gcc            : ChangeLog reg-stack.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: reg-stack3.C 

Log message:
	PR target/12712
	* reg-stack.c (convert_regs_1): Create an arbitrary input stack
	if the block has no predecessors.
	(convert_regs_2): Document the problem with successors whose
	only predecessor is the block to be processed.
	(convert_regs): Don't create the arbitrary input stack here.

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.787&r2=1.16114.2.788
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reg-stack.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.117.2.4&r2=1.117.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.309&r2=1.2261.2.310
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/reg-stack3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1

Comment 6 Eric Botcazou 2003-10-25 13:04:00 UTC
See http://gcc.gnu.org/ml/gcc-patches/2003-10/msg02117.html