public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: murphychen@mail2000.com.tw
To: gcc-gnats@gcc.gnu.org
Subject: inline-asm/10035: arm register r0 is corrupted
Date: Wed, 12 Mar 2003 06:36:00 -0000 [thread overview]
Message-ID: <20030312063426.9247.qmail@sources.redhat.com> (raw)
>Number: 10035
>Category: inline-asm
>Synopsis: arm register r0 is corrupted
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 12 06:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: gcc-3.0
>Release: unknown-1.0
>Organization:
>Environment:
linux
>Description:
When assigning local variable to use arm register r0, the initialization of the local variable will be ignored.
>How-To-Repeat:
compile the c code again.
>Fix:
Don't know how to fix.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="gccbug.txt"
Content-Disposition: inline; filename="gccbug.txt"
$cat test.c
int fun(char *s, long n) {
register long a asm("r0");
a = 3;
fun("xxx", a);
a = 5;
return a;
}
$ arm-linux-gcc -Os -S -mthumb -mcpu=arm7tdmi -mtune=arm7tdmi -march=armv4t test.c
$ cat test.s
@ Generated by gcc 3.0 for ARM/elf
.file "test.c"
.code 16
.section .rodata
.align 2
.LC0:
.ascii "xxx\000"
.text
.align 2
.global fun
.thumb_func
.type fun,function
fun:
push {lr}
ldr r0, .L3
mov r1, r0
bl fun
mov r0, #5
pop {pc}
.L4:
.align 2
.L3:
.word .LC0
.Lfe1:
.size fun,.Lfe1-fun
.ident "GCC: (GNU) 3.0"
$ arm-linux-gcc -v -Os -S -mthumb -mcpu=arm7tdmi -mtune=arm7tdmi -march=armv4t test.c
Reading specs from /usr/local/arm/3.0/lib/gcc-lib/arm-linux/3.0/specs
Configured with: ../../src/gcc-3.0/configure --target=arm-linux --prefix=/usr/local/arm/3.0 --enable-languages=c,c++,objc,f77,java --enable-threads
Thread model: posix
gcc version 3.0
/usr/local/arm/3.0/lib/gcc-lib/arm-linux/3.0/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__ELF__ -D__unix -D__linux -Asystem=unix -Asystem=posix -Acpu=arm -Amachine=arm -D__CHAR_UNSIGNED__ -D__OPTIMIZE_SIZE__ -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -D__ARM_ARCH_4T__ -D__APCS_32__ -D__ARMEL__ -D__THUMBEL__ -D__thumb__ test.c -quiet -dumpbase test.c -mthumb -mcpu=arm7tdmi -mtune=arm7tdmi -march=armv4t -Os -version -o test.s
GNU CPP version 3.0 (cpplib) (ARM GNU/Linux with ELF)
GNU C version 3.0 (arm-linux)
compiled by GNU C version 2.95.2 20000220 (Debian GNU/Linux).
#include "..." search starts here:
#include <...> search starts here:
/usr/local/arm/3.0/lib/gcc-lib/arm-linux/3.0/include
/usr/local/arm/3.0/arm-linux/sys-include
/usr/local/arm/3.0/arm-linux/include
End of search list.
next reply other threads:[~2003-03-12 6:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-12 6:36 murphychen [this message]
2003-03-12 11:58 rearnsha
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=20030312063426.9247.qmail@sources.redhat.com \
--to=murphychen@mail2000.com.tw \
--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).