This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/60598] [4.9 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2239


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60598

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-20
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |krebbel at gcc dot gnu.org,
                   |                            |rth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly more reduced testcase for -march=z196 -mtune=zEC12 -m64 -O2 -fpic:
struct S { unsigned a, b[32]; };

void
foo (struct S *x, struct S *y)
{
  unsigned a = y->a, i;
  if (x == y)
    for (i = 0; i < a - 1 - i; i++)
      {
        unsigned t = x->b[i];
        x->b[i] = x->b[a - 1 - i];
        x->b[a - 1 - i] = t;
      }
  else
    {
      x->a = a;
      for (i = 0; i < a; i++)
        x->b[i] = y->b[a - 1 - i];
    }
}

Regressed with r208165, seems that the function is shrink-wrapped and the *.ce3
pass incorrectly moves a frame related insn across a conditional jump to a code
label right before the frame related insn, where the conditional jump falls
through into a simple_return.  Having the register save ahead of such
conditional jump means the *.dwarf2 pass sees a path where we reach with saved,
but not restored, register the simple_return and die.
(jump_insn 48 39 156 3 (parallel [
            (set (pc)
                (if_then_else (ne (reg/v:SI 1 %r1 [orig:87 a ] [87])
                        (const_int 1 [0x1]))
                    (label_ref:DI 164)
                    (pc)))
            (set (reg:SI 1 %r1 [orig:89 D.1427 ] [89])
                (plus:SI (reg/v:SI 1 %r1 [orig:87 a ] [87])
                    (const_int -1 [0xffffffffffffffff])))
            (clobber (scratch:SI))
            (clobber (reg:CC 33 %cc))
        ]) pr60598.c:8 619 {doloop_si64}
     (expr_list:REG_UNUSED (reg:CC 33 %cc)
        (int_list:REG_BR_PROB 9697 (nil)))
 -> 164)
(code_label 156 48 151 5 14 "" [1 uses])
(note 151 156 166 5 [bb 5] NOTE_INSN_BASIC_BLOCK)
(jump_insn 166 151 153 5 (simple_return) -1
     (nil)
 -> simple_return)
(barrier 153 166 164)
(code_label 164 153 163 6 15 "" [1 uses])
(note 163 164 147 6 [bb 6] NOTE_INSN_BASIC_BLOCK)
(insn/f 147 163 148 6 (set (reg:DI 16 %f0)
        (reg:DI 11 %r11)) pr60598.c:5 -1
     (expr_list:REG_DEAD (reg:DI 11 %r11)
        (nil)))
(note 148 147 126 6 NOTE_INSN_PROLOGUE_END)
is what we have in the *.peephole2 dump, and the *.ce3 pass moves insn 147 and
148 right before insn 48.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]