http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47535
Summary: -mno-thumb option does not work on ARM compiler configured --with-mode=thumb Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver AssignedTo: unassig...@gcc.gnu.org ReportedBy: len...@cs.columbia.edu I have a GCC 4.6.0 (SVN trunk) compiler configured targeting arm-linux, configured with the --with-mode=thumb option to generate Thumb code by default. When I pass the compiler the -mno-thumb option, it ignores the option, and generates Thumb code anyway. The -marm option works as expected, and is usable as a workaround; however, this option is only mentioned in one place in the gcc documentation, in passing, with no description, and is displayed by gcc --help as "This option lacks documentation". It looks like what's happening is that when I pass -mno-thumb to the driver, the driver passes it to cc1, but appends an additional -mthumb option as well. (The file arm-sad.c contains arm-specific inline assembly. I can provide it if needed, but its contents are not relevant.) $ ~/GCC/FSF/bin/arm-linux-gnueabi-gcc -v -mno-thumb -c arm-sad.c Using built-in specs. COLLECT_GCC=/home/jonathan/GCC/FSF/bin/arm-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/home/jonathan/GCC/FSF/libexec/gcc/arm-linux-gnueabi/4.6.0/lto-wrapper Target: arm-linux-gnueabi Configured with: ../svn/Trunk/configure -v --prefix=/home/jonathan/GCC/FSF/ --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-float=softfp --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include --with-headers=/usr/arm-linux-gnueabi/include --with-libs=/usr/arm-linux-gnueabi/lib --build=i486-linux-gnu --host=i486-linux-gnu --target=arm-linux-gnueabi CC=gcc build_alias=i486-linux-gnu host_alias=i486-linux-gnu target_alias=arm-linux-gnueabi --enable-languages=c,c++,fortran,objc,obj-c++ Thread model: posix gcc version 4.6.0 20110129 (experimental) (GCC) COLLECT_GCC_OPTIONS='-v' '-mno-thumb' '-c' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb' /home/jonathan/GCC/FSF/libexec/gcc/arm-linux-gnueabi/4.6.0/cc1 -quiet -v arm-sad.c -quiet -dumpbase arm-sad.c -mno-thumb -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -auxbase arm-sad -version -o /tmp/ccplOMN0.s GNU C (GCC) version 4.6.0 20110129 (experimental) (arm-linux-gnueabi) compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version 2.4.2-p1, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 #include "..." search starts here: #include <...> search starts here: /home/jonathan/GCC/FSF/lib/gcc/arm-linux-gnueabi/4.6.0/include /home/jonathan/GCC/FSF/lib/gcc/arm-linux-gnueabi/4.6.0/include-fixed /home/jonathan/GCC/FSF/lib/gcc/arm-linux-gnueabi/4.6.0/../../../../arm-linux-gnueabi/sys-include /home/jonathan/GCC/FSF/lib/gcc/arm-linux-gnueabi/4.6.0/../../../../arm-linux-gnueabi/include End of search list. GNU C (GCC) version 4.6.0 20110129 (experimental) (arm-linux-gnueabi) compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version 2.4.2-p1, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: b9b1ff16910c968c736abbcf1f0e1a41 COLLECT_GCC_OPTIONS='-v' '-mno-thumb' '-c' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb' /home/jonathan/GCC/FSF/libexec/gcc/arm-linux-gnueabi/4.6.0/as -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -meabi=5 -o arm-sad.o /tmp/ccplOMN0.s /tmp/ccplOMN0.s: Assembler messages: /tmp/ccplOMN0.s:38: Error: Thumb does not support register post-indexing -- `ldr r4,[r0],r1' /tmp/ccplOMN0.s:38: Error: Thumb does not support register post-indexing -- `ldr r5,[r2],ip' /tmp/ccplOMN0.s:38: Error: Thumb does not support register post-indexing -- `ldr r4,[r0],r1' /tmp/ccplOMN0.s:38: Error: Thumb does not support register post-indexing -- `ldr r5,[r2],ip' /tmp/ccplOMN0.s:38: Error: Thumb does not support register post-indexing -- `ldr r4,[r0],r1' /tmp/ccplOMN0.s:38: Error: Thumb does not support register post-indexing -- `ldr r5,[r2],ip'