]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/82145
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Sep 2017 08:30:28 +0000 (08:30 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Sep 2017 08:30:28 +0000 (08:30 +0000)
* postreload.c (reload_cse_simplify_operands): Skip
NOTE_INSN_DELETED_LABEL similarly to skipping CODE_LABEL.

* gcc.target/i386/pr82145.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252791 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/postreload.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr82145.c [new file with mode: 0644]

index 4ff9f794bf94a31c8419f89dd8345807c630f297..4711d4e16c1e516401e3fb703426e56202b01117 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/82145
+       * postreload.c (reload_cse_simplify_operands): Skip
+       NOTE_INSN_DELETED_LABEL similarly to skipping CODE_LABEL.
+
 2017-09-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/68823
index 4660df2d6468a8a28c95f9d842d4aa4c9a308d2c..6026e21295aab140c176776252d33e5590a5c043 100644 (file)
@@ -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;
index d98cdbf33cb54563805c795710b07a758ff9a055..b47923b38025409306db205af405bbeb360b7e97 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/82145
+       * gcc.target/i386/pr82145.c: New test.
+
 2017-09-15  Paul Thomas  <pault@gcc.gnu.org>
 
        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 (file)
index 0000000..99945da
--- /dev/null
@@ -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;
+}