Bug 12900 - [3.3/3.4 Regression] g++ ICE in rtl_verify_flow_info_1
Summary: [3.3/3.4 Regression] g++ ICE in rtl_verify_flow_info_1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P3 critical
Target Milestone: 3.3.3
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code
: 13283 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-04 22:25 UTC by snyder
Modified: 2004-01-17 04:22 UTC (History)
4 users (show)

See Also:
Host: i686-*-*
Target: i686-*-*
Build: i686-*-*
Known to work:
Known to fail:
Last reconfirmed: 2003-11-04 23:26:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description snyder 2003-11-04 22:25:41 UTC
g++ 3.4 ICEs on the code below, when compiled with -O2 or above.

$ g++ -c -O2 x.cc
x.cc: In function `void track_match()':
x.cc:22: error: in basic block 1:
x.cc:22: error: flow control insn inside a basic block
(call_insn:HI 69 68 195 1 (set (reg:DF %st)
        (call (mem:QI (symbol_ref:SI ("_Z4ext1d") [flags 0x41] <function_decl 0x400f6dec ext1>) [0 S1 A8])
            (const_int 8 [0x8]))) 489 {*call_value_0} (insn_list:REG_DEP_ANTI 56 (insn_list:REG_DEP_ANTI 164 (insn_list:REG_DEP_ANTI 57 (insn_list:REG_DEP_ANTI
67 (insn_list:REG_DEP_ANTI 68 (insn_list:REG_DEP_ANTI 163 (insn_list:REG_DEP_ANTI 61 (insn_list:REG_DEP_ANTI 160 (nil)))))))))
    (expr_list:REG_EH_REGION (const_int 2 [0x2])
        (nil))
    (nil))
x.cc:22: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2055
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$

Environment:
System: Linux karma 2.4.19-emp_2419p5a829i #1 Tue Sep 3 17:42:17 EST 2002 i686 i686 i386 GNU/Linux
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77

How-To-Repeat:

Compile with -O2.

-------------------------------------------------------------------


struct array {
  double data;
  virtual ~array();
};

double glob;
double ext1(double);
int nmuons;

void track_match()
{
  array vecdca;
  if (glob < 10) return;
  double p = glob*5;
  double phi = vecdca.data;
  ext1 (vecdca.data-glob);
  ext1 (phi*2);
  if (1 < p)
    ++nmuons; 
}
-------------------------------------------------------------------
Comment 1 snyder 2003-11-04 22:25:41 UTC
Fix:
	<how to correct or work around the problem, if known (multiple lines)>
Comment 2 Andrew Pinski 2003-11-04 23:26:36 UTC
From Phil's regression hunter: (for -mtune=pentiumpro)
: Search converges between 2003-09-21-trunk (#407) and 2003-09-22-trunk (#408).
Comment 3 Wolfgang Bangerth 2003-11-04 23:27:28 UTC
Confirmed. A regression on mainline w.r.t. 3.3.2.

W.
Comment 4 Andrew Pinski 2003-11-04 23:42:56 UTC
I want to say it is related to this patch <http://gcc.gnu.org/ml/gcc-patches/2003-09/
msg01313.html> as -fno-exceptions causes GCC not to ICE.
Comment 5 Eric Botcazou 2003-11-05 07:03:09 UTC
Not a chance: there is no delay slots on x86!
Comment 6 Eric Botcazou 2003-11-05 07:04:53 UTC
This is again:

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.


As I installed the patch, I'll investigate.
Comment 7 Andrew Pinski 2003-11-05 07:13:32 UTC
I can also reproduce it on i686-apple-darwin6.8.
Comment 8 Eric Botcazou 2003-11-05 07:23:54 UTC
I'd rather have the 'Host' field populated for my bugs because Bugzilla displays
it by default instead of the 'Target' field and I want to be able to quickly
differentiate SPARC problems from other problems.
Comment 9 Eric Botcazou 2003-11-27 06:30:48 UTC
The regression is latent on the 3.3 branch.
Comment 10 CVS Commits 2003-11-27 06:36:55 UTC
Subject: Bug 12900

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2003-11-27 06:36:52

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

Log message:
	PR target/12900
	* reg-stack (move_for_stack_reg): New prototype.  Return
	whether a control flow insn was deleted.
	(subst_stack_regs_pat): Likewise, using the information provided
	by move_for_stack_reg.
	(subst_stack_regs): Likewise, using the information provided
	by subst_stack_regs_pat.
	(convert_regs_1): Record whether a control flow insn was deleted,
	using the information provided by subst_stack_regs.  Purge dead
	edges only if a control flow insn was deleted.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1833&r2=2.1834
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reg-stack.c.diff?cvsroot=gcc&r1=1.137&r2=1.138
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3206&r2=1.3207
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/reg-stack4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 11 CVS Commits 2003-12-01 08:10:26 UTC
Subject: Bug 12900

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2003-12-01 08:10:18

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

Log message:
	Backport from mainline:
	
	2003-11-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
	
	PR target/12900
	* reg-stack (move_for_stack_reg): New prototype.  Return
	whether a control flow insn was deleted.
	(subst_stack_regs_pat): Likewise, using the information provided
	by move_for_stack_reg.
	(subst_stack_regs): Likewise, using the information provided
	by subst_stack_regs_pat.
	(convert_regs_1): Record whether a control flow insn was deleted,
	using the information provided by subst_stack_regs.  Purge dead
	edges only if a control flow insn was deleted.

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.811&r2=1.16114.2.812
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.5&r2=1.117.2.6
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.318&r2=1.2261.2.319
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/reg-stack4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1

Comment 12 Eric Botcazou 2003-12-01 08:12:16 UTC
See http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00342.html
Comment 13 Eric Botcazou 2003-12-03 15:50:56 UTC
*** Bug 13283 has been marked as a duplicate of this bug. ***