[Bug target/71695] m68k: long long multiplication broken
martin at netbsd dot org
gcc-bugzilla@gcc.gnu.org
Sun Jul 3 09:08:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71695
Martin Husemann <martin at netbsd dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |---
--- Comment #3 from Martin Husemann <martin at netbsd dot org> ---
Chuck Silvers has looked a bit closer and found that while it does not happen
with an unmodified gcc 5.4 configured for --target=m68k-linux, it is
reproducable when configuring for --target=m68k-netbsdelf.
One of the differences in the config is the override to BIGGEST_ALIGNEMENT in
netbsd-elf.h:
For m68k/SVR4, some types (doubles for example) are aligned on 8 byte
boundaries */
#undef BIGGEST_ALIGNMENT
#define BIGGEST_ALIGNMENT 64
while Linux uses:
Most published ABIs say that ints should be aligned on 16-bit
boundaries, but CPUs with 32-bit busses get better performance
aligned on 32-bit boundaries. */
#define BIGGEST_ALIGNMENT (TARGET_ALIGN_INT ? 32 : 16)
This seems to have been there since prehistoric times. Removing this override
makes gcc generate the same code as shown by Andreas.
More interesting though is that adding BIGGEST_ALIGNMENT 64 to the linux
configuration does NOT make gcc emit the bad code, so there must be another
factor involved. Any hints appreciated!
More information about the Gcc-bugs
mailing list