[Bug sim/27483] aarch64: adds test failing when adding 0x80000000 & 0xffffffff
wilson at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Mon Mar 1 23:28:57 GMT 2021
https://sourceware.org/bugzilla/show_bug.cgi?id=27483
--- Comment #5 from Jim Wilson <wilson at gcc dot gnu.org> ---
I realize that the 32-bit signed add has undefined result in the presence of
overflow. But no matter what result you get, it can't match the result you get
for the 64-bit signed add when there is an overflow. So the code should work.
Unless maybe compiler optimization is doing something surprising which defeats
our code.
After some experimentation, I discovered that the code works with gcc-9 but
fails with gcc-10. Because gcc-10 is doing some unexpected optimization of the
expression.
I can fix it by changing the code to
if (sresult != (int32_t)sresult)
flags |= V;
which should give the same result as before. it works for me with gcc-10 on
the sim testsuite, though I haven't tried wider testing.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list