public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/6324: On ARC-ELF32 target, optimizations generate uncomplete code
@ 2002-04-16 7:56 francisco.blasco
0 siblings, 0 replies; only message in thread
From: francisco.blasco @ 2002-04-16 7:56 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-16 14:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-16 7:56 optimization/6324: On ARC-ELF32 target, optimizations generate uncomplete code francisco.blasco
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).