From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9372 invoked by alias); 12 Mar 2003 06:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9346 invoked by uid 71); 12 Mar 2003 06:36:01 -0000 Resent-Date: 12 Mar 2003 06:36:01 -0000 Resent-Message-ID: <20030312063601.9345.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, murphychen@mail2000.com.tw Received: (qmail 9248 invoked by uid 48); 12 Mar 2003 06:34:26 -0000 Message-Id: <20030312063426.9247.qmail@sources.redhat.com> Date: Wed, 12 Mar 2003 06:36:00 -0000 From: murphychen@mail2000.com.tw Reply-To: murphychen@mail2000.com.tw To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: inline-asm/10035: arm register r0 is corrupted X-SW-Source: 2003-03/txt/msg00650.txt.bz2 List-Id: >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.