public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: francisco.blasco@ds2.es
To: gcc-gnats@gcc.gnu.org
Subject: optimization/6324: On ARC-ELF32 target, optimizations generate uncomplete code
Date: Tue, 16 Apr 2002 07:56:00 -0000	[thread overview]
Message-ID: <20020416145322.20255.qmail@sources.redhat.com> (raw)


>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:


                 reply	other threads:[~2002-04-16 14:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020416145322.20255.qmail@sources.redhat.com \
    --to=francisco.blasco@ds2.es \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).