Skip to content

Commit a7061c2

Browse files
author
hjl
committed
i386: Skip DF_REF_INSN if DF_REF_INSN_INFO is false
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254013 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent d2d928c commit a7061c2

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

gcc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2017-10-23 H.J. Lu <[email protected]>
2+
3+
PR target/82673
4+
* config/i386/i386.c (ix86_finalize_stack_frame_flags): Skip
5+
DF_REF_INSN if DF_REF_INSN_INFO is false.
6+
17
2017-10-23 Jan Hubicka <[email protected]>
28

39
* i386.c (dimode_scalar_chain::compute_convert_gain): Use

gcc/config/i386/i386.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12692,10 +12692,13 @@ ix86_finalize_stack_frame_flags (void)
1269212692
for (ref = DF_REG_USE_CHAIN (HARD_FRAME_POINTER_REGNUM);
1269312693
ref; ref = next)
1269412694
{
12695-
rtx_insn *insn = DF_REF_INSN (ref);
12695+
next = DF_REF_NEXT_REG (ref);
12696+
if (!DF_REF_INSN_INFO (ref))
12697+
continue;
12698+
1269612699
/* Make sure the next ref is for a different instruction,
1269712700
so that we're not affected by the rescan. */
12698-
next = DF_REF_NEXT_REG (ref);
12701+
rtx_insn *insn = DF_REF_INSN (ref);
1269912702
while (next && DF_REF_INSN (next) == insn)
1270012703
next = DF_REF_NEXT_REG (next);
1270112704

gcc/testsuite/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2017-10-23 H.J. Lu <[email protected]>
2+
3+
PR target/82673
4+
* gcc.target/i386/pr82673.c: New test.
5+
16
2017-10-23 Jakub Jelinek <[email protected]>
27

38
* lib/scanasm.exp (dg-function-on-line): Accept optional column info.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* { dg-do compile } */
2+
/* { dg-options "-O0 -fno-omit-frame-pointer -fvar-tracking-assignments" } */
3+
4+
register long *B asm ("ebp");
5+
6+
long y = 20;
7+
8+
void
9+
bar (void) /* { dg-error "frame pointer required, but reserved" } */
10+
{
11+
B = &y;
12+
} /* { dg-error "bp cannot be used in asm here" } */

0 commit comments

Comments
 (0)