This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/31938] Wrong code on int to short cast on armeb



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]