This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/58805] [4.8/4.9 Regression] Inline assembly wrongly optimized out when inside a conditional
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Oct 2013 22:59:17 +0000
- Subject: [Bug inline-asm/58805] [4.8/4.9 Regression] Inline assembly wrongly optimized out when inside a conditional
- Auto-submitted: auto-generated
- References: <bug-58805-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58805
--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #6)
> I mean:
> asm("":"=r"(*a));
> is the same as:
> asm("":"=r"(temp));
> *a = temp;
I'm not convinced it is the same. In the first case,
the compiler doesn't seem to be aware there is a
memory write; should it? The asm doesn't say there
is one: it says you write to a register. So the two
arms look the same and are merged, the memory write
is later done by reload.
But the compiler should at least warn.