Bug 44973 - SH: libjava failed to build with 'flow control insn inside a basic block'
Summary: SH: libjava failed to build with 'flow control insn inside a basic block'
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Bernd Schmidt
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-07-17 21:27 UTC by Kazumoto Kojima
Modified: 2010-07-19 11:27 UTC (History)
3 users (show)

See Also:
Host:
Target: sh4-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Potential fix (382 bytes, patch)
2010-07-17 22:22 UTC, Bernd Schmidt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kazumoto Kojima 2010-07-17 21:27:52 UTC
On sh4-unknown-linux-gnu,

r162270 | bernds | 2010-07-17 08:47:46 +0900 (Sat, 17 Jul 2010) | 26 lines

caused a build failure during compiling libjava:

../trunk/libjava/verify.cc: In member function 'void _Jv_BytecodeVerifier::merge_into(int, _Jv_BytecodeVerifier::state*)':
../trunk/libjava/verify.cc:1527:3: error: in basic block 200:
../trunk/libjava/verify.cc:1527:3: error: flow control insn inside a basic block
(insn 1318 1315 1309 200 ../trunk/libjava/verify.cc:686 (set (reg:SI 1 r1 [orig:447 D.22193 ] [447])
        (mem/s:SI (plus:SI (reg/v/f:SI 9 r9 [orig:452 from_state ] [452])
                (const_int 24 [0x18])) [45 MEM[(const struct type &)from_state_22(D) + 16].pc+0 S4 A32])) 176 {movsi_ie} (expr_list:REG_EH_REGION (const_int 3 [0x3])
        (nil)))
../trunk/libjava/verify.cc:1527:3: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2030
P../trunk/libjava/verify.cc: In member function 'void _Jv_BytecodeVerifier::merge_into(int, _Jv_BytecodeVerifier::state*)':
../trunk/libjava/verify.cc:1527:3: error: in basic block 200:
../trunk/libjava/verify.cc:1527:3: error: flow control insn inside a basic block
(insn 1318 1315 1309 200 ../trunk/libjava/verify.cc:686 (set (reg:SI 1 r1 [orig:447 D.22193 ] [447])
        (mem/s:SI (plus:SI (reg/v/f:SI 9 r9 [orig:452 from_state ] [452])
                (const_int 24 [0x18])) [45 MEM[(const struct type &)from_state_22(D) + 16].pc+0 S4 A32])) 176 {movsi_ie} (expr_list:REG_EH_REGION (const_int 3 [0x3])
        (nil)))
../trunk/libjava/verify.cc:1527:3: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2030


It seems that the patch below restores the build on SH, though
I'm not sure if it's the right thing to do.

diff -up ORIG/trunk/gcc/postreload.c trunk/gcc/postreload.c
--- ORIG/trunk/gcc/postreload.c	2010-07-17 10:31:33.000000000 +0900
+++ trunk/gcc/postreload.c	2010-07-17 23:07:42.000000000 +0900
@@ -924,6 +924,9 @@ reload_combine_recognize_const_pattern (
 	  if (must_move_add && use_ruid < last_jump_ruid)
 	    break;
 
+	  if (find_reg_note (use_insn, REG_EH_REGION, NULL))
+	    break;
+
 	  /* If the add clobbers another hard reg in parallel, don't move
 	     it past a real set of this hard reg.  */
 	  if (must_move_add && clobbered_regno >= 0
Comment 1 Bernd Schmidt 2010-07-17 22:22:21 UTC
Created attachment 21237 [details]
Potential fix

Does this fix it?
Comment 2 Steven Bosscher 2010-07-17 22:34:07 UTC
Ideally, the code would look at the CFG instead, like the loop above it, that uses FOR_EACH_BB_REVERSE. But most of the postreload.c code ignores the CFG, unfortunately...
Comment 3 Kazumoto Kojima 2010-07-18 06:15:38 UTC
(In reply to comment #1)
> Does this fix it?

Yes.  With it, the failure go away and my cross sh-linux
build has just completed successfully.

Comment 4 Rainer Orth 2010-07-19 11:15:24 UTC
libada failed to build with the same error in i386-pc-solaris2.10.  You patch
patch fixed that as well.
Comment 5 Bernd Schmidt 2010-07-19 11:27:21 UTC
Fixed now.