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 inline-asm/61692] New: ICE in extract_insn in recog.c for asm with many parameters


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61692

            Bug ID: 61692
           Summary: ICE in extract_insn in recog.c for asm with many
                    parameters
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gccbugzilla at limegreensocks dot com

There is an ICE coming from recog.c in extract_insn.  The problem occurs when
you have 30 inputs and 1 goto in an asm instruction.  That's 31 operands and
MAX_RECOG_OPERANDS only allows 30.

The problem comes from this line in expand_asm_operands in cfgexpand.c:

  if (ninputs + noutputs > MAX_RECOG_OPERANDS)

Changing that to:

  if (ninputs + noutputs + nlabels > MAX_RECOG_OPERANDS)

generates the (expected) message:

  error: more than 30 operands in 'asm'

You can see the ICE with this code:

int main()
{
loop:

   asm goto (""
      : /* no outputs */
      : "r" (0), "r" (1), "r" (2), "r" (3), "r" (4), 
        "r" (5), "r" (6), "r" (7), "r" (8), "r" (9), 
        "r" (10), "r" (11), "r" (12), "r" (13), "r" (14), 
        "r" (15), "r" (16), "r" (17), "r" (18), "r" (19),
        "r" (20), "r" (21), "r" (22), "r" (23), "r" (24), 
        "r" (25), "r" (26), "r" (27), "r" (28), "r" (29)
      : /* no clobbers */
      : loop);
}


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