]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ira: volatile asm's are not moveable (PR82602)
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 18 Oct 2017 21:15:24 +0000 (23:15 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 18 Oct 2017 21:15:24 +0000 (23:15 +0200)
A volatile asm statement can not be moved (relative to other volatile
asm, etc.), but IRA would do it nevertheless.  This patch fixes it.

PR rtl-optimization/82602
* ira.c (rtx_moveable_p): Return false for volatile asm.

From-SVN: r253871

gcc/ChangeLog
gcc/ira.c

index 07255baa87bfa9e405401076b778392347d273c9..eec164f9b98ac928106cb695cff6595999f8024b 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-18  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR rtl-optimization/82602
+       * ira.c (rtx_moveable_p): Return false for volatile asm.
+
 2017-10-17  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/82549
index 087ba6ab1f41fd0081377bdcac3d6330e1c90a14..d4003150bdbdd054821cf423b3eb56ba3451c586 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4405,6 +4405,12 @@ rtx_moveable_p (rtx *loc, enum op_type type)
         for a reason.  */
       return false;
 
+    case ASM_OPERANDS:
+      /* The same is true for volatile asm: it has unknown side effects, it
+         cannot be moved at will.  */
+      if (MEM_VOLATILE_P (x))
+       return false;
+
     default:
       break;
     }