This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/31938] Wrong code on int to short cast on armeb
- From: "bigfoot at private dot dk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 May 2007 21:22:11 -0000
- Subject: [Bug target/31938] Wrong code on int to short cast on armeb
- References: <bug-31938-14550@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from bigfoot at private dot dk 2007-05-31 21:22 -------
(In reply to comment #1)
> However, I suspect your test case is wrong. Unpatched versions of gcc default
> to little-endian mode on arm, even if you configure with
> --target=arm${foo}b-${bar}.
> Since you didn't pass -mbig-endian when compiling the test case, gcc will
> generate code assuming little-endian data representation. The assembly code you
> listed is actually correct for little-endian.
Yes, indeed it is correct for little endian, so I assumed it was some
optimisation wrongly applied to big endian. However, you're entirely right.
Using -mbig-endian makes it produce code that looks more correct.
What I'm asking myself now is what sense there is to this default. Shouldn't it
default to big endian?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31938