https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71436

            Bug ID: 71436
           Summary: [7 Regression] Segmentation fault in
                    arm_output_multireg_pop
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: arm

The testcase:
#pragma pack(1)
struct S0
{
  volatile int f0;
  short f2;
};

void foo (struct S0 *);
int a, d;
static struct S0 b[5];
static struct S0 c;
void fn1 ();
void
main ()
{
  {
    struct S0 e;
    for (; d; fn1 ())
      {
        {
          a = 3;
          for (; a >= 0; a -= 1)
            {
              {
                e = c;
              }
              b[a] = e;
            }
        }
      }
  }
  foo (b);
}

ICEs on arm with -O3  -marm -march=armv7-a -mfloat-abi=hard -mfpu=neon

arm-crash.c: In function 'main':
arm-crash.c:33:1: internal compiler error: Segmentation fault
 }
 ^
0xb152fe crash_signal
        $SRC/gcc/toplev.c:333
0xe3e921 arm_output_multireg_pop(rtx_def**, bool, rtx_def*, bool, bool)
        $SRC/gcc/config/arm/arm.c:17809
0x101fe24 output_390
        $SRC/gcc/config/arm/arm.md:11344
0x8284a5 get_insn_template(int, rtx_def*)
        $SRC/gcc/final.c:2077
0x82b3eb final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        $SRC/gcc/final.c:2948
0x82bbba final(rtx_insn*, _IO_FILE*, int)
        $SRC/gcc/final.c:2045
0x82c053 rest_of_handle_final
        $SRC/gcc/final.c:4441
0x82c053 execute
        $SRC/gcc/final.c:4516
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

The rtx that's causing the segfault is:

(parallel [
        (set (reg:SI 0 r0)
            (mem/u/c:SI (reg/f:SI 5 r5 [147]) [2 c+0 S4 A32]))
        (set (mem/c:SI (plus:SI (reg/f:SI 102 sfp)
                    (const_int -4 [0xfffffffffffffffc])) [4 %sfp+-12 S4 A32])
            (mem/u/c:SI (plus:SI (reg/f:SI 5 r5 [147])
                    (const_int 4 [0x4])) [2 c+4 S4 A32]))
    ])

where the code is trying to extract:
REGNO (XEXP (XVECEXP (operands[0], 0, i), 0))

That second set mem-mem looks dodgy.


Bisection shows it started with r235765 but I'm not sure it's the root cause

Reply via email to