From: Iain Buclaw Date: Mon, 30 Mar 2020 22:24:13 +0000 (+0200) Subject: d: Always set ASM_VOLATILE_P on asm statements (PR94425) X-Git-Tag: basepoints/gcc-11~495 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30d26118f96fa542ee078834bc3cb4eef6730451;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index d27f83e77d47..73fd18449545 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,9 @@ +2020-04-07 Iain Buclaw + + PR d/94425 + * toir.cc (IRVisitor::visit (GccAsmStatement *)): Set ASM_VOLATILE_P + on all asm statements. + 2020-04-01 Iain Buclaw PR d/90136 diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc index 21e31dc93d40..6aaf10bf4e4b 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); }