We should check DF_REF_INSN_INFO before accessing DF_REF_INSN.
gcc/
PR target/82673
* config/i386/i386.c (ix86_finalize_stack_frame_flags): Skip
DF_REF_INSN if DF_REF_INSN_INFO is false.
gcc/testsuite/
PR target/82673
* gcc.target/i386/pr82673.c: New test.
From-SVN: r254013
+2017-10-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/82673
+ * config/i386/i386.c (ix86_finalize_stack_frame_flags): Skip
+ DF_REF_INSN if DF_REF_INSN_INFO is false.
+
2017-10-23 Jan Hubicka <hubicka@ucw.cz>
* i386.c (dimode_scalar_chain::compute_convert_gain): Use
for (ref = DF_REG_USE_CHAIN (HARD_FRAME_POINTER_REGNUM);
ref; ref = next)
{
- rtx_insn *insn = DF_REF_INSN (ref);
+ next = DF_REF_NEXT_REG (ref);
+ if (!DF_REF_INSN_INFO (ref))
+ continue;
+
/* Make sure the next ref is for a different instruction,
so that we're not affected by the rescan. */
- next = DF_REF_NEXT_REG (ref);
+ rtx_insn *insn = DF_REF_INSN (ref);
while (next && DF_REF_INSN (next) == insn)
next = DF_REF_NEXT_REG (next);
+2017-10-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/82673
+ * gcc.target/i386/pr82673.c: New test.
+
2017-10-23 Jakub Jelinek <jakub@redhat.com>
* lib/scanasm.exp (dg-function-on-line): Accept optional column info.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O0 -fno-omit-frame-pointer -fvar-tracking-assignments" } */
+
+register long *B asm ("ebp");
+
+long y = 20;
+
+void
+bar (void) /* { dg-error "frame pointer required, but reserved" } */
+{
+ B = &y;
+} /* { dg-error "bp cannot be used in asm here" } */