This is the mail archive of the gcc-prs@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]

optimization/6324: On ARC-ELF32 target, optimizations generate uncomplete code



>Number:         6324
>Category:       optimization
>Synopsis:       On ARC-ELF32 target, optimizations generate uncomplete code
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 16 07:56:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     francisco.blasco@ds2.es
>Release:        gcc version 3.1 20020408
>Organization:
>Environment:
Linux Slackware 8.0
gcc version 2.95.3 20010315 (release)
>Description:
I compiled gcc for ARC-ELF32 target.
When you compiled this code:

int ll(int k)
{
  return k<0?1234:0;
}

It generates next assembler output (bad):

        .cpu base
        .section .text
        .align 4
        .global _ll
        .type   _ll,@function
_ll:
        ; BEGIN PROLOGUE ; vars= 0, regs= 0, args= 0, extra= 0
        st fp,[sp]
        mov fp,sp
        ; END PROLOGUE
        mov r0,1234
        mov.ge r0,0
        ; EPILOGUE
        j.d blink
        ld.a fp,[sp,0]
.Lfe1:
        .size   _ll,.Lfe1-_ll
        .ident  "GCC: (GNU) 3.1 20020408 (prerelease)"

And the right output is:
        .cpu base
        .section .text
        .align 4
        .global _ll
        .type   _ll,@function
_ll:
        ; BEGIN PROLOGUE ; vars= 0, regs= 0, args= 0, extra= 0
        st fp,[sp]
        mov fp,sp
        ; END PROLOGUE
        sub.f 0,r0,0
        mov r0,1234
        mov.ge r0,0
        ; EPILOGUE
        j.d blink
        ld.a fp,[sp,0]
.Lfe1:
        .size   _ll,.Lfe1-_ll
        .ident  "GCC: (GNU) 3.1 20020408 (prerelease)"

The problem is on the optimization reduction (I think).

Note: I'm working with ARC processor. If you want, I can become a tester.

>How-To-Repeat:
arc-elf32-gcc -S -O2 -o - example.c 
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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