public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/47727] [x32] internal compiler error: Segmentation fault
Date: Mon, 14 Feb 2011 06:16:00 -0000	[thread overview]
Message-ID: <bug-47727-4-Wq6zR8T63i@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <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.


  parent reply	other threads:[~2011-02-14  5:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  3:37 [Bug target/47727] New: " hjl.tools at gmail dot com
2011-02-14  3:54 ` [Bug target/47727] " hjl.tools at gmail dot com
2011-02-14  4:19 ` hjl.tools at gmail dot com
2011-02-14  6:16 ` hjl.tools at gmail dot com [this message]
2011-02-14  6:38 ` [Bug middle-end/47727] [x32] Many passes can't handle const symbol when Pmode != ptr_mode hjl.tools at gmail dot com
2011-02-14 13:58 ` hjl.tools at gmail dot com
2011-02-14 14:28 ` rguenther at suse dot de
2011-02-14 14:52 ` hjl.tools at gmail dot com
2011-02-14 17:31 ` hjl.tools at gmail dot com
2011-02-14 19:02 ` hjl at gcc dot gnu.org
2011-07-14 22:51 ` hjl at gcc dot gnu.org
2011-07-28  9:23 ` ubizjak at gmail dot com
2011-08-06 14:52 ` hjl at gcc dot gnu.org
2011-08-08 15:57 ` hjl.tools at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47727-4-Wq6zR8T63i@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).