[Bug target/77600] M68K: gcc generates rubbish with -mshort
law at redhat dot com
gcc-bugzilla@gcc.gnu.org
Thu Nov 17 18:52:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77600
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |law at redhat dot com
Resolution|--- |INVALID
--- Comment #2 from Jeffrey A. Law <law at redhat dot com> ---
This is a similar issue as I outlined in the other m68k -mshort BZ. This time
we need to look at how INTPTR_TYPE, which is defined in terms of
LONG_TYPE_SIZE. When LONG_TYPE_SIZE == 32, INTPTR_TYPE will be an "int"
-mshort changes the size of an int from 32 to 16 bits.
Thus conversions to/from sizetype are going to do things you don't expect
unless you know sizetype is 16 bits.
Again, if you configure for a bare metal target such as m68k-elf or avoid using
-mshort on your linux target, you'll get the desired and expected result.
More information about the Gcc-bugs
mailing list