This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/58805] [4.8/4.9 Regression] Inline assembly wrongly optimized out when inside a conditional


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]