Bug 48637 - %c in ARM inline asm leads to ICE (in arm_print_operand)
Summary: %c in ARM inline asm leads to ICE (in arm_print_operand)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-16 06:34 UTC by Rabin Vincent
Modified: 2011-06-27 21:12 UTC (History)
1 user (show)

See Also:
Host:
Target: arm
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-05-21 18:14:27


Attachments
minimized test case (184 bytes, text/plain)
2011-04-16 06:34 UTC, Rabin Vincent
Details
reduced test case (123 bytes, text/plain)
2011-04-16 11:50 UTC, Mikael Pettersson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rabin Vincent 2011-04-16 06:34:48 UTC
Created attachment 24009 [details]
minimized test case

Compiling the attached file leads to ICE with a GCC 4.6.0 ARM cross-compiler.  It uses inline asm with %c and an element of a structure.  If the referenced "state" element is made the first element of the structure, the file compiles successfully.

~/tmp$ ~/x-tools/arm-unknown-eabi/bin/arm-unknown-eabi-gcc -c test.c
test.c: In function 'test':
test.c:25:1: internal compiler error: in arm_print_operand, at config/arm/arm.c:16147
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

~/tmp$ ~/x-tools/arm-unknown-eabi/bin/arm-unknown-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/home/rabin/x-tools/arm-unknown-eabi/bin/arm-unknown-eabi-gcc
COLLECT_LTO_WRAPPER=/home/rabin/x-tools/arm-unknown-eabi/libexec/gcc/arm-unknown-eabi/4.6.0/lto-wrapper
Target: arm-unknown-eabi
Configured with: /home/rabin/dev/crosstool-ng/.build/src/gcc-4.6.0/configure --build=x86_64-build_unknown-linux-gnu --host=x86_64-build_unknown-linux-gnu --target=arm-unknown-eabi --prefix=/home/rabin/x-tools/arm-unknown-eabi --with-local-prefix=/home/rabin/x-tools/arm-unknown-eabi/arm-unknown-eabi/sysroot --disable-multilib --disable-libmudflap --with-sysroot=/home/rabin/x-tools/arm-unknown-eabi/arm-unknown-eabi/sysroot --with-newlib --enable-threads=no --disable-shared --with-pkgversion=crosstool-NG-hg_default@2404_8988576c491a --with-arch=armv5 --disable-__cxa_atexit --with-gmp=/home/rabin/dev/crosstool-ng/.build/arm-unknown-eabi/build/static --with-mpfr=/home/rabin/dev/crosstool-ng/.build/arm-unknown-eabi/build/static --with-mpc=/home/rabin/dev/crosstool-ng/.build/arm-unknown-eabi/build/static --with-ppl=no --with-cloog=no --with-libelf=no --disable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-nls --enable-symvers=gnu --enable-languages=c
Thread model: single
gcc version 4.6.0 (crosstool-NG-hg_default@2404_8988576c491a)
Comment 1 Mikael Pettersson 2011-04-16 11:50:01 UTC
Created attachment 24010 [details]
reduced test case

Further reduced test case.  "asm goto" is not needed, "%c0" suffices.  ICEs gcc-4.3.5, 4.4.5, 4.5.2, and 4.7-20110409.
Comment 2 Richard Earnshaw 2011-05-21 18:14:27 UTC
Confirmed.  The back-end doesn't currently know how to handle symbol+offset in %c.
Comment 3 Richard Earnshaw 2011-06-27 21:09:32 UTC
Author: rearnsha
Date: Mon Jun 27 21:09:25 2011
New Revision: 175565

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175565
Log:
	PR target/48637
	* arm.c (arm_print_operand): Allow sym+offset.  Don't abort on invalid
	asm operands.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c
Comment 4 Richard Earnshaw 2011-06-27 21:12:03 UTC
Fixed on trunk