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

            Bug ID: 66749
           Summary: [4.9/5/6] gcc.target/i386/addr-sel-1.c fails to merge
                    array index into one instruction with -m32 -mregparm=3
                    or with -miamcu
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: julia.koval at intel dot com
  Target Milestone: ---

The test tries to generate code for:
return a[i+1] + b[i+1];

For -m32 gcc generates proper code:
movl    4(%esp), %eax
movsbl  a+1(%eax), %ecx
movsbl  b+1(%eax), %eax
addl    %ecx, %eax

However with -m32 -mregparm=3 the b value fails to be combined:
movsbl  a+1(%eax), %edx
incl    %eax
movsbl  b(%eax), %eax
addl    %edx, %eax

The error also remains with -mregparm=1/2 or with -miamcu.

Reply via email to