[Bug target/86314] [7/8/9 Regression] GCC 7.x and 8.x zero out "eax" before using "rax" in "lock bts"

matthieum.147192 at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 26 11:28:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86314

--- Comment #5 from Matthieu M <matthieum.147192 at gmail dot com> ---
(In reply to Jakub Jelinek from comment #4)
> Created attachment 44322 [details]
> gcc9-pr86314.patch
> 
> Untested fix.  The peephole2s didn't expect that an insn with a set of flags
> and some other set could use the reg it wants to clear inside of the lhs of
> the second set.

Thank for your quick assessment of the issue.

Would you mind explaining the impact?

For now, I have removed the offending instance of "__atomic_fetch_or" from my
code. Is this a sufficient work-around or can you think of other
constructs/instructions which may trigger this particular bug?


More information about the Gcc-bugs mailing list