This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/47727] [x32] internal compiler error: Segmentation fault
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Feb 2011 05:18:38 +0000
- Subject: [Bug target/47727] [x32] internal compiler error: Segmentation fault
- Auto-submitted: auto-generated
- References: <bug-47727-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47727
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2011-02-14 05:18:23 UTC ---
(In reply to comment #2)
> cse1 generates:
>
> ;; Succ edge EXIT [100.0%] (fallthru)
>
> ;; Insn is not within a basic block
> (insn 63 57 64 (set (reg:SI 100)
> (symbol_ref:SI ("__CTOR_END__") [flags 0x2] <var_decl 0x7ffff0ced000
> __CTOR_END__>)) -1
> (nil))
>
> ;; Insn is not within a basic block
> (insn 64 63 65 (parallel [
> (set (reg:SI 99)
> (plus:SI (reg:SI 100)
> (const_int -4 [0xfffffffffffffffc])))
> (clobber (reg:CC 17 flags))
> ]) -1
> (nil))
>
> ;; Insn is not within a basic block
> (insn 65 64 0 (set (reg:DI 98)
> (zero_extend:DI (reg:SI 99))) -1
> (nil))
>
> This may lead to the DF problem.
This is because cse_insn calls fold_rtx with
(gdb) call debug_rtx (x)
(zero_extend:DI (reg/f:SI 95))
(gdb) call debug_rtx (insn)
(insn 37 36 38 3 (set (reg/f:DI 94)
(zero_extend:DI (reg/f:SI 95))) c.i:7 115 {*zero_extendsidi2_rex64}
(nil))
(gdb)
It leads to
switch (GET_RTX_CLASS (code))
{
case RTX_UNARY:
{
/* We can't simplify extension ops unless we know the
original mode. */
if ((code == ZERO_EXTEND || code == SIGN_EXTEND)
&& mode_arg0 == VOIDmode)
break;
new_rtx = simplify_unary_operation (code, mode,
const_arg0 ? const_arg0 : folded_arg0,
mode_arg0);
}
break;
Breakpoint 7, emit_insn (x=0x7ffff0d46900)
at /export/gnu/import/git/gcc-x32/gcc/emit-rtl.c:4791
4791 rtx last = get_last_insn();
(gdb) bt
#0 emit_insn (x=0x7ffff0d46900)
at /export/gnu/import/git/gcc-x32/gcc/emit-rtl.c:4791
#1 0x00000000006f0e87 in emit_move_insn_1 (x=0x7ffff0d42dc0, y=0x7ffff0d42b40)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:3305
#2 0x00000000006f125a in emit_move_insn (x=0x7ffff0d42dc0, y=0x7ffff0d42b40)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:3395
#3 0x00000000006d503e in copy_to_mode_reg (mode=SImode, x=0x7ffff0d42b40)
at /export/gnu/import/git/gcc-x32/gcc/explow.c:637
#4 0x00000000008d9656 in expand_binop_directly (mode=SImode,
binoptab=0x1809e20, op0=0x7ffff0d42b40, op1=0x7ffff0dea430,
target=0x7ffff0d42da0, unsignedp=1, methods=OPTAB_LIB_WIDEN,
last=0x7ffff0cf1980) at /export/gnu/import/git/gcc-x32/gcc/optabs.c:1461
#5 0x00000000008d99c2 in expand_binop (mode=SImode, binoptab=0x1809e20,
op0=0x7ffff0d42b40, op1=0x7ffff0dea430, target=0x7ffff0d42da0,
unsignedp=1, methods=OPTAB_LIB_WIDEN)
at /export/gnu/import/git/gcc-x32/gcc/optabs.c:1551
#6 0x00000000008d9185 in expand_simple_binop (mode=SImode, code=PLUS,
op0=0x7ffff0d42b40, op1=0x7ffff0dea430, target=0x7ffff0d42da0,
unsignedp=1, methods=OPTAB_LIB_WIDEN)
at /export/gnu/import/git/gcc-x32/gcc/optabs.c:1295
#7 0x0000000000701383 in force_operand (value=0x7ffff0d473a8,
target=0x7ffff0d42da0) at /export/gnu/import/git/gcc-x32/gcc/expr.c:6452
#8 0x00000000006d4fed in copy_to_mode_reg (mode=SImode, x=0x7ffff0d473a8)
---Type <return> to continue, or q <return> to quit---
at /export/gnu/import/git/gcc-x32/gcc/explow.c:633
#9 0x00000000008df8d7 in maybe_emit_unop_insn (icode=2221,
target=0x7ffff0d42d80, op0=0x7ffff0d473a8, code=ZERO_EXTEND)
at /export/gnu/import/git/gcc-x32/gcc/optabs.c:3746
#10 0x00000000008dfa49 in emit_unop_insn (icode=2221, target=0x7ffff0d42d80,
op0=0x7ffff0d473a8, code=ZERO_EXTEND)
at /export/gnu/import/git/gcc-x32/gcc/optabs.c:3776
#11 0x00000000006e9df4 in convert_move (to=0x7ffff0d42d80,
from=0x7ffff0d473a8, unsignedp=1)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:612
#12 0x00000000006ea5de in convert_modes (mode=DImode, oldmode=SImode,
x=0x7ffff0d473a8, unsignedp=1)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:791
#13 0x00000000006d4971 in convert_memory_address_addr_space (to_mode=DImode,
x=0x7ffff0d473a8, as=0 '\000')
at /export/gnu/import/git/gcc-x32/gcc/explow.c:408
#14 0x00000000006d488d in convert_memory_address_addr_space (to_mode=DImode,
x=0x7ffff0d43d10, as=0 '\000')
at /export/gnu/import/git/gcc-x32/gcc/explow.c:379
#15 0x00000000009bceb1 in simplify_unary_operation_1 (code=ZERO_EXTEND,
mode=DImode, op=0x7ffff0d43d10)
at /export/gnu/import/git/gcc-x32/gcc/simplify-rtx.c:1111
#16 0x00000000009bafa8 in simplify_unary_operation (code=ZERO_EXTEND,
---Type <return> to continue, or q <return> to quit---
mode=DImode, op=0x7ffff0d43d10, op_mode=SImode)
at /export/gnu/import/git/gcc-x32/gcc/simplify-rtx.c:526
#17 0x0000000001044375 in fold_rtx (x=0x7ffff0d43d20, insn=0x7ffff0d463f0)
at /export/gnu/import/git/gcc-x32/gcc/cse.c:3350
#18 0x00000000010470f8 in cse_insn (insn=0x7ffff0d463f0)
at /export/gnu/import/git/gcc-x32/gcc/cse.c:4501
It generates a bunch of orphaned instructions.