[Bug target/51106] [4.5/4.6/4.7 Regression] ICE in move_insn, at haifa-sched.c:2314

2012-01-19 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106

--- Comment #4 from Andrey Belevantsev  2012-01-20 
06:22:31 UTC ---
Author: abel
Date: Fri Jan 20 06:22:24 2012
New Revision: 183325

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183325
Log:
gcc:/
2012-01-20  Andrey Belevantsev  

  PR target/51106
  * function.c (instantiate_virtual_regs_in_insn): Use
  delete_insn_and_edges when removing a wrong asm insn.

testsuite:/
2012-01-20  Jakub Jelinek  

  PR target/51106
  * gcc.dg/torture/pr51106-1.c: New test.
  * gcc.dg/torture/pr51106-2.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/torture/pr51106-1.c
trunk/gcc/testsuite/gcc.dg/torture/pr51106-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/function.c
trunk/gcc/testsuite/ChangeLog


[Bug target/51106] [4.5/4.6/4.7 Regression] ICE in move_insn, at haifa-sched.c:2314

2012-01-19 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106

--- Comment #3 from Jakub Jelinek  2012-01-19 
09:43:16 UTC ---
Shorter testcase for gcc.c-torture/compile/ :
int
foo (int x)
{
  asm goto ("" : : "i" (x) : : lab);
  return 1;
lab:
  return 0;
}

Yeah, I think delete_insn_and_edges is the right fix here.  You might also add
into the testsuite:
int
bar (int x)
{
  asm goto ("" : : "i" (x) : : lab);
  __builtin_unreachable ();
lab:
  return 0;
}
(fortunately at this point the bb ending with the asm goto still has a fallthru
successor, otherwise purge_dead_edges wouldn't work).


[Bug target/51106] [4.5/4.6/4.7 Regression] ICE in move_insn, at haifa-sched.c:2314

2012-01-19 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106

Andrey Belevantsev  changed:

   What|Removed |Added

 CC||abel at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org

--- Comment #2 from Andrey Belevantsev  2012-01-19 
09:24:27 UTC ---
Well, the instantiate virtual regs pass just deletes the asm as having
impossible constraints and does not clean up cfg after itself.  As the asm is
actually a jump in this case, everything blows up.

The trivial patch below makes this work for -O[012].  Any other places in
function.c need patching up? Jakub, what do you think?

diff --git a/gcc/function.c b/gcc/function.c
index fcb79f5..94e51f4 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1737,7 +1737,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
   if (!check_asm_operands (PATTERN (insn)))
{
  error_for_asm (insn, "impossible constraint in %");
- delete_insn (insn);
+ delete_insn_and_edges (insn);
}
 }
   else


[Bug target/51106] [4.5/4.6/4.7 Regression] ICE in move_insn, at haifa-sched.c:2314

2012-01-04 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106

Richard Guenther  changed:

   What|Removed |Added

   Priority|P3  |P2


[Bug target/51106] [4.5/4.6/4.7 Regression] ICE in move_insn, at haifa-sched.c:2314

2012-01-03 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106

Richard Guenther  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-01-03
   Target Milestone|--- |4.5.4
Summary|[4.5 regression] ICE in |[4.5/4.6/4.7 Regression]
   |move_insn, at   |ICE in move_insn, at
   |haifa-sched.c:2314  |haifa-sched.c:2314
 Ever Confirmed|0   |1
  Known to fail||4.7.0

--- Comment #1 from Richard Guenther  2012-01-03 
11:49:52 UTC ---
On trunk we ICE with

t.i:32:25: warning: initialization from incompatible pointer type [enabled by
default]
t.i:2:5: warning: always_inline function might not be inlinable [-Wattributes]
t.i: In function 'aes_decrypt':
t.i:30:1: error: in basic block 8:
t.i:30:1: error: flow control insn inside a basic block
(jump_insn 34 33 47 8 (parallel [
(asm_operands/v ("1: jmp %l1
2:
.section .altinstructions,"a"
.balign 4
.long 1b
.long 0
.word %P0
.byte 2b - 1b
.byte 0
.previous
") ("") 0 [
(const_int 24 [0x18])
]
 [
(asm_input:HI ("i") (null):0)
]
 [
(label_ref:SI 22)
] t.i:30)
(clobber (reg:QI 18 fpsr))
(clobber (reg:QI 17 flags))
]) t.i:4 -1
 (expr_list:REG_UNUSED (reg:QI 18 fpsr)
(expr_list:REG_UNUSED (reg:QI 17 flags)
(nil)))
 -> 22)
t.i:30:1: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2002
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

at -O2 and

t.i:4:2: error: impossible constraint in 'asm'
t.i:9:1: error: too many outgoing branch edges from bb 2
t.i:9:1: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

with -O1.