summaryrefslogtreecommitdiff
path: root/gcc/d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-03-31 00:24:13 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-04-07 09:44:02 +0200
commit30d26118f96fa542ee078834bc3cb4eef6730451 (patch)
tree6a7ce62cfcde87f976621f5e01387b21f12d527b /gcc/d
parent42867b875c386d23cae0ad66c50ab80cba47528d (diff)
d: Always set ASM_VOLATILE_P on asm statements (PR94425)
gcc/d/ChangeLog: PR d/94425 * toir.cc (IRVisitor::visit (GccAsmStatement *)): Set ASM_VOLATILE_P on all asm statements.
Diffstat (limited to 'gcc/d')
-rw-r--r--gcc/d/ChangeLog6
-rw-r--r--gcc/d/toir.cc5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog
index d27f83e77d4..73fd1844954 100644
--- a/gcc/d/ChangeLog
+++ b/gcc/d/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-07 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/94425
+ * toir.cc (IRVisitor::visit (GccAsmStatement *)): Set ASM_VOLATILE_P
+ on all asm statements.
+
2020-04-01 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/90136
diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc
index 21e31dc93d4..6aaf10bf4e4 100644
--- a/gcc/d/toir.cc
+++ b/gcc/d/toir.cc
@@ -1427,8 +1427,9 @@ public:
if (s->args == NULL && s->clobbers == NULL)
ASM_INPUT_P (exp) = 1;
- /* Asm statements are treated as volatile unless 'pure'. */
- ASM_VOLATILE_P (exp) = !(s->stc & STCpure);
+ /* All asm statements are assumed to have a side effect. As a future
+ optimization, this could be unset when building in release mode. */
+ ASM_VOLATILE_P (exp) = 1;
add_stmt (exp);
}