First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15159
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: rsandifo@gcc.gnu.org <rsandifo@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Wolfgang Bangerth <bangerth@dealii.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
block_sparse_matrix.ii preprocessed sources text/plain 2004-04-26 23:33 95.44 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15159 depends on: Show dependency tree
Show dependency graph
Bug 15159 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-04-27 17:27 Opened: 2004-04-26 23:31
The attached testcase compiles fine with gcc 3.3, but ICEs with 
gcc 3.4 like so: 
 
deal.II/lac> c++ -c -O2 block_sparse_matrix.ii 
block_sparse_matrix.ii: In member function `void 
BlockSparseMatrix<number>::reinit(const BlockSparsityPattern&) [with number = 
double]': 
block_sparse_matrix.ii:34301: error: in basic block 35: 
block_sparse_matrix.ii:34301: error: flow control insn inside a basic block 
(call_insn 746 672 751 35 (call_placeholder 711 673 0 0 (call_insn 713 712 714 
(parallel [ 
                (set (reg:SI 2 $2) 
                    (call (mem:SI (reg:SI 321) [0 S4 A32]) 
                        (const_int 0 [0x0]))) 
                (clobber (reg:SI 31 $31)) 
            ]) -1 (nil) 
        (nil) 
        (expr_list (use (reg:SI 28 $28)) 
            (expr_list (use (reg:SI 4 $4)) 
                (nil))))) -1 (nil) 
    (nil) 
    (nil)) 
block_sparse_matrix.ii:34301: internal compiler error: in 
rtl_verify_flow_info_1, at cfgrtl.c:2053 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
Since this machine is just about too slow, I will not be able to 
provide reduced code for a while. If someone has an interest in 
beating me to it, please feel more than welcome! 
 
W.

------- Comment #1 From Wolfgang Bangerth 2004-04-26 23:33 -------
Created an attachment (id=6166) [edit]
preprocessed sources

------- Comment #2 From Wolfgang Bangerth 2004-04-26 23:50 -------
I should note that I could trigger this ICE on three different files 
(two of them had the same kind of loop, the third one didn't; the 
common theme was the access to a previously assigned reference), 
so it doesn't seem to be a really rare thing. 
 
Who is the author of rtl_verify_flow_info_1? 
 
W. 

------- Comment #3 From Andrew Pinski 2004-04-26 23:56 -------
rtl_verify_flow_info_1 came about with this patch but it was split out from
rtl_verify_flow_info so it most 
likely not a bug in rtl_verify_flow_info_1 or rtl_verify_flow_info but a bug in
the RTL optimizers, this is a 
verifier which verifiers if the RTL is wrong.

Sun Jun  8 15:52:17 CEST 2003  Jan Hubicka  <jh@suse.cz>

        * i386.md (subsi_3_zext, sse2_nandv2di3): Fix predicates.
        * i386.c (k8_avoid_jump_misspredicts): Fix debug output.

        * cfg.c (verify_flow_info): Move IL independent checks from cfgrtl
here.
        (dump_bb): New based on old dump_bb in cfgrtl.c
        (debug_bb, debug_bb_n): Move the functions from cfgrtl.c here.
        * cfghooks.h (cfgh_verify_flow_info): Return status.
        * cfglayout.c (cfg_layout_finalize): Verify CFG correctness.
        * cfgrtl.c (debug_bb, debug_bb_n): Move to cfg.c
        (dump_bb): Remove generic parts.
        (rtl_verify_flow_info_1): Break out from rtl_verify_flow_info.
        (rtl_verify_flow_info): Only check things dependeing on linearized RTL.

------- Comment #4 From Wolfgang Bangerth 2004-04-27 00:23 -------
Jan, does this ICE trigger something with you? 
W. 

------- Comment #5 From Wolfgang Bangerth 2004-04-27 14:27 -------
Here is a small testcase: 
-------------------------- 
struct S { 
    S (); 
    void reinit (); 
}; 
 
struct P { 
    P & operator= (S *); 
    S * operator -> () const; 
}; 
 
class X { 
    void reinit (); 
    P p; 
}; 
 
void X::reinit () 
{ 
 p = new S(); 
 p->reinit (); 
} 
----------------------------- 
 
bangerth/tmp> /home/staff/bangerth/bin/sgi/gcc-3.4.0/bin/c++ -O2 -c x.cc 
x.cc: In member function `void X::reinit()': 
x.cc:20: error: in basic block 0: 
x.cc:20: error: flow control insn inside a basic block 
(call_insn 86 6 90 0 (call_placeholder 51 13 0 0 (call_insn 53 52 54 (parallel [ 
                (set (reg:SI 2 $2) 
                    (call (mem:SI (reg:SI 193) [0 S4 A32]) 
                        (const_int 0 [0x0]))) 
                (clobber (reg:SI 31 $31)) 
            ]) -1 (nil) 
        (nil) 
        (expr_list (use (reg:SI 28 $28)) 
            (expr_list (use (reg:SI 4 $4)) 
                (nil))))) -1 (nil) 
    (nil) 
    (nil)) 
x.cc:20: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2053 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
bangerth/tmp> /home/staff/bangerth/bin/sgi/gcc-3.4.0/bin/c++ -v 
Reading specs from /home/staff/bangerth/bin/sgi/gcc-3.4.0/lib/gcc/mips-sgi-irix6.5/3.4.0/specs 
Configured with: ../gcc-3.4.0/configure --prefix=/home/staff/bangerth/bin/sgi/gcc-3.4.0 
--enable-languages=c,c++,f77 --enable-checking 
Thread model: single 
gcc version 3.4.0 
 
W. 

------- Comment #6 From Wolfgang Bangerth 2004-04-27 14:33 -------
Uh, this goes even smaller: 
---------------------- 
struct S { 
    S (); 
    void foo (); 
}; 
 
struct P { 
    P (S *); 
    S s; 
}; 
 
void bar () { 
 P p = new S(); 
 p.s.foo (); 
} 
---------------------------- 
bangerth/tmp> /home/staff/bangerth/bin/sgi/gcc-3.4.0/bin/c++ -O2 -c x.cc 
x.cc: In function `void bar()': 
x.cc:14: error: in basic block 0: 
x.cc:14: error: flow control insn inside a basic block 
(call_insn 85 104 98 0 (call_placeholder 50 12 0 0 (call_insn 52 51 53 (parallel [ 
                (set (reg:SI 2 $2) 
                    (call (mem:SI (reg:SI 194) [0 S4 A32]) 
                        (const_int 0 [0x0]))) 
                (clobber (reg:SI 31 $31)) 
            ]) -1 (nil) 
        (nil) 
        (expr_list (use (reg:SI 28 $28)) 
            (expr_list (use (reg:SI 4 $4)) 
                (nil))))) -1 (nil) 
    (nil) 
    (nil)) 
x.cc:14: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2053 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
W. 

------- Comment #7 From Volker Reichelt 2004-04-27 17:27 -------
Confirmed (example in comment #6).

------- Comment #8 From rsandifo@gcc.gnu.org 2004-05-01 20:14 -------
Been looking at this a little today.  It seems to be specific to sibling
calls (there's no problem if you use -fno-optimize-sibling-calls) and
probably depends on how aggressively the backend tries to use them.
MIPS is very aggressive ;)

Taking the reduced example:

void bar () { 
  P p = new S(); 
  p.s.foo (); 
}

the first statement ends up in a call_placeholder.  The call inside the
placeholder can throw, so it (correctly?) satisfies control_flow_insn_p.
It is initially placed in its own basic block.

However, reachable_handlers returns an empty list for call_placeholders,
so there are no EH edges from this block.  The only edge is a fallthru
to the second block.  This convinces try_optimize_cfg that the blocks
can be merged by merge_blocks_move().

I'm not sure when I'll next have time to look at this, but maybe the
above will be enough to trigger an Aha!

------- Comment #9 From rsandifo@gcc.gnu.org 2004-06-19 09:17 -------
Think I finally have a handle on this.  Testing a patch now.

------- Comment #10 From rsandifo@gcc.gnu.org 2004-06-20 11:00 -------
Patch posted here:

   http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01601.html

(Mark, this is a somewhat target-independent 3.4.0 ICE-on-valid regression.)

------- Comment #11 From Mark Mitchell 2004-06-21 06:14 -------
Subject: Re:  [3.4 regression] ICE in rtl_verify_flow_info_1

rsandifo at gcc dot gnu dot org wrote:

> ------- Additional Comments From rsandifo at gcc dot gnu dot org  2004-06-20 11:00 -------
> Patch posted here:
> 
>    http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01601.html
> 
> (Mark, this is a somewhat target-independent 3.4.0 ICE-on-valid regression.)

This is OK for 3.4.1; please check in ASAP.

Thanks,


------- Comment #12 From CVS Commits 2004-06-21 06:30 -------
Subject: Bug 15159

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rsandifo@gcc.gnu.org	2004-06-21 06:30:18

Modified files:
	gcc            : ChangeLog tree.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: placeholder1.C 

Log message:
	PR rtl-optimization/15159
	* tree.c (unsafe_for_reeval): Return 2 for TRY_CATCH_EXPRs.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.515&r2=2.2326.2.516
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.342.2.3&r2=1.342.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.211&r2=1.3389.2.212
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/placeholder1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1


------- Comment #13 From rsandifo@gcc.gnu.org 2004-06-21 06:34 -------
Patch applied to 3.4 branch.  Not a problem on mainline:
see gcc-patches link.

First Last Prev Next    No search results available      Search page      Enter new bug