From 6fb89e62a88e66d35b0114e653ebbef44fecaa42 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Wed, 18 Oct 2017 23:15:24 +0200 Subject: [PATCH] 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: r253871 --- gcc/ChangeLog | 5 +++++ gcc/ira.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07255baa87bf..eec164f9b98a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-10-18 Segher Boessenkool + + PR rtl-optimization/82602 + * ira.c (rtx_moveable_p): Return false for volatile asm. + 2017-10-17 Jakub Jelinek PR tree-optimization/82549 diff --git a/gcc/ira.c b/gcc/ira.c index 087ba6ab1f41..d4003150bdbd 100644 --- 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; } -- 2.47.2