http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50305

             Bug #: 50305
           Summary: Inline asm reload failure when building Linux kernel
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: uweig...@gcc.gnu.org
            Target: arm-linux-gnueabi


Created attachment 25204
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25204
Reduced test case

Building the Linux kernel with current mainline fails with certain sets of
options due to a reload failure on an atomic.h inline asm.

The attached test case reproduces the problem when compiled with
  -O2 -fno-omit-frame-pointer -marm -march=armv7-a

core.i: In function ‘event_alloc’:
core.i:34:2: error: ‘asm’ operand requires impossible reload
core.i:34:2: error: ‘asm’ operand requires impossible reload

Note that while the inline asm may be somewhat inefficient (enforcing a "+Qo"
constraint on an operand that is never used in the assembly), there is nothing
invalid about the set of constraints (and there are enough registers
available).

The problem seems instead to be caused by unfortunate interactions between
ARM's legitimize_reload_address routine and subsequent iterations through
find_reloads common code.

Reply via email to