From 854dde43ae85c54a12430a656d01a0db9637b139 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 15 Sep 2017 10:30:28 +0200 Subject: [PATCH] re PR middle-end/82145 (i386/pr38988.c, i386/pr46254.c, i386/pr55154.c, i386/pr81766.c fails) PR target/82145 * postreload.c (reload_cse_simplify_operands): Skip NOTE_INSN_DELETED_LABEL similarly to skipping CODE_LABEL. * gcc.target/i386/pr82145.c: New test. From-SVN: r252791 --- gcc/ChangeLog | 6 ++++++ gcc/postreload.c | 7 +++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr82145.c | 12 ++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr82145.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4ff9f794bf9..4711d4e16c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-09-15 Jakub Jelinek + + PR target/82145 + * postreload.c (reload_cse_simplify_operands): Skip + NOTE_INSN_DELETED_LABEL similarly to skipping CODE_LABEL. + 2017-09-15 Richard Biener PR tree-optimization/68823 diff --git a/gcc/postreload.c b/gcc/postreload.c index 4660df2d646..6026e21295a 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -409,9 +409,12 @@ reload_cse_simplify_operands (rtx_insn *insn, rtx testreg) CLEAR_HARD_REG_SET (equiv_regs[i]); /* cselib blows up on CODE_LABELs. Trying to fix that doesn't seem - right, so avoid the problem here. Likewise if we have a constant - and the insn pattern doesn't tell us the mode we need. */ + right, so avoid the problem here. Similarly NOTE_INSN_DELETED_LABEL. + Likewise if we have a constant and the insn pattern doesn't tell us + the mode we need. */ if (LABEL_P (recog_data.operand[i]) + || (NOTE_P (recog_data.operand[i]) + && NOTE_KIND (recog_data.operand[i]) == NOTE_INSN_DELETED_LABEL) || (CONSTANT_P (recog_data.operand[i]) && recog_data.operand_mode[i] == VOIDmode)) continue; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d98cdbf33cb..b47923b3802 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-15 Jakub Jelinek + + PR target/82145 + * gcc.target/i386/pr82145.c: New test. + 2017-09-15 Paul Thomas PR fortran/82184 diff --git a/gcc/testsuite/gcc.target/i386/pr82145.c b/gcc/testsuite/gcc.target/i386/pr82145.c new file mode 100644 index 00000000000..99945dadc31 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr82145.c @@ -0,0 +1,12 @@ +/* PR target/82145 */ +/* { dg-do compile { target { pie && lp64 } } } */ +/* { dg-options "-O2 -fpie -mcmodel=large -march=haswell" } */ + +int l; + +int +main () +{ + l++; + return 0; +} -- 2.30.2