public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/3428: GCC-2.95.3 on target arc-elf32 generates bad code.
@ 2001-06-26 10:16 francisco.blasco
0 siblings, 0 replies; 2+ messages in thread
From: francisco.blasco @ 2001-06-26 10:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 3428
>Category: c
>Synopsis: GCC-2.95.3 on target arc-elf32 generates bad code.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Jun 26 10:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: francisco.blasco@ds2.es
>Release: unknown-1.0
>Organization:
>Environment:
gcc-2.95.3
>Description:
If you compiles GCC-2.95.3 for arc-elf32 target, it appears to work nicely.
But when you use the cross-compiler ans tries to compile next code:
int ll(int k)
{
return k<0?1234:0;
}
It generates bad assembler code:
.cpu base
__gnu_compiled_c:
.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.gt %r0,0 <<<<<<<<<<< BAD!!!!!!!!!
; EPILOGUE
j.d %blink
ld.a %fp,[%sp,0]
.Lfe1:
.size ll,.Lfe1-ll
.ident "GCC: (GNU) 2.95.3 20010315 (release)"
The instruction "mov.gt %r0, 0" must be "mov.ge %r0, 0".
>How-To-Repeat:
arc-elf32-gcc -S -O2 -o - kk3.c
>Fix:
I don't know. I learned to do some modifications to the arc.md file to add
some new intructions, but I don't know where I must search.
I can try to fix it, but I believe I don't know enough the gcc code.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="kk3.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="kk3.c"
aW50IGxsKGludCBrKQp7CiAgcmV0dXJuIGs8MD8xMjM0OjA7Cn0K
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c/3428: GCC-2.95.3 on target arc-elf32 generates bad code.
@ 2001-06-26 15:48 aoliva
0 siblings, 0 replies; 2+ messages in thread
From: aoliva @ 2001-06-26 15:48 UTC (permalink / raw)
To: francisco.blasco, gcc-bugs, gcc-prs, nobody
Synopsis: GCC-2.95.3 on target arc-elf32 generates bad code.
State-Changed-From-To: open->closed
State-Changed-By: aoliva
State-Changed-When: Tue Jun 26 15:48:56 2001
State-Changed-Why:
Duplicate of 3429
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3428&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-06-26 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-26 10:16 c/3428: GCC-2.95.3 on target arc-elf32 generates bad code francisco.blasco
2001-06-26 15:48 aoliva
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).