aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2017-10-18 23:08:18 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2017-10-18 23:08:18 +0200
commit9d0d0a5a1312edb8c32160c5645cf72841efa12d (patch)
treea97fa2d4b933691cb3efb830d5626c60d5ec62f6 /gcc/ira.c
parentb04bebdb1dee362255b99e91cc48798291448dc6 (diff)
downloadgcc-9d0d0a5a1312edb8c32160c5645cf72841efa12d.zip
gcc-9d0d0a5a1312edb8c32160c5645cf72841efa12d.tar.gz
gcc-9d0d0a5a1312edb8c32160c5645cf72841efa12d.tar.bz2
ira: volatile asm's are not moveable (PR82602)
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: r253869
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 046ce3b..8c93d3d 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4400,6 +4400,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;
}