I have a simple testcase: void test() { } # arm-linux-gcc test.c -S -O2 produces: test: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. @ lr needed for prologue mov pc, lr # arm-linux-gcc test.c -S -O2 -mcpu=arm7tdmi-s produces: test: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. @ lr needed for prologue bx lr -mthumb-interwork is disabled by default (vide man). why gcc4 produces "bx lr" ? (gcc34 works fine). # arm-linux-gcc -v Reading specs from /usr/lib/gcc/arm-linux/4.0.0/specs Configured with: ../configure --prefix=/usr --with-sysroot=/home/users/pluto/rpm/BUILD/gcc-4.0-20050130/fake-root --infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin --libdir=/usr/lib --libexecdir=/usr/lib --disable-shared --disable-threads --enable-languages=c,c++ --enable-c99 --enable-long-long --with-gnu-as --with-gnu-ld --with-system-zlib --with-multilib --with-sysroot=/home/users/pluto/rpm/BUILD/gcc-4.0-20050130/fake-root --without-x --target=arm-linux --host=i686-pld-linux --build=i686-pld-linux Thread model: single gcc version 4.0.0 20050130 (experimental)
-- Summary: unexpected "bx lr" in arm mode. Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: regression AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at pld-linux dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-linux GCC host triplet: i686-linux GCC target triplet: arm-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19935