From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26914 invoked by alias); 12 Nov 2003 21:54:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26528 invoked by uid 48); 12 Nov 2003 21:54:05 -0000 Date: Wed, 12 Nov 2003 21:54:00 -0000 From: "czang at panasas dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20031112215357.13028.czang@panasas.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/13028] New: ia64 gcc with -O2 does not store value in register into local varible X-Bugzilla-Reason: CC X-SW-Source: 2003-11/txt/msg01064.txt.bz2 List-Id: This can be demonstrated with the following sample program: /* * program starts */ #define ntoh64(_src_, _dest_) { \ unsigned int *src_p = (unsigned int *) _src_; \ unsigned int *dest_p = (unsigned int *) _dest_; \ *dest_p++ = *src_p++; \ *dest_p++ = *src_p++; \ } void call(unsigned long *number_p) { unsigned long seqno; ntoh64(number_p, &seqno); printf("in reply_received: seqno is %lu\n", seqno); printf("in reply_received: seqno is %lu\n", seqno); } main() { unsigned long number = 1010101; call(&number); } /* * program ends */ The following is the compile command line: [build-hp1] gcc -v -save-temps -O2 compiler.c Reading specs from /usr/lib/gcc-lib/ia64-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) /usr/lib/gcc-lib/ia64-redhat-linux/2.96/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix -D__LP64__ -D__ELF__ -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -D__linux__ -D__unix__ -D__LP64__ -D__ELF__ -D__linux -D__unix -Asystem(linux) -Acpu(ia64) -Amachine(ia64) -D__OPTIMIZE__ -D__LONG_MAX__=9223372036854775807L compiler.c compiler.i GNU CPP version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) (cpplib) (IA-64) ignoring nonexistent directory "/usr/ia64-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc-lib/ia64-redhat-linux/2.96/include /usr/include End of search list. /usr/lib/gcc-lib/ia64-redhat-linux/2.96/cc1 compiler.i -mb-step -quiet -dumpbase compiler.c -O2 -version -o compiler.s GNU C version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) (ia64-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2). as -x -o compiler.o compiler.s /usr/lib/gcc-lib/ia64-redhat-linux/2.96/collect2 -dynamic-linker /lib/ld-linux-ia64.so.2 /usr/lib/gcc-lib/ia64-redhat-linux/2.96/../../../crt1.o /usr/lib/gcc-lib/ia64-redhat-linux/2.96/../../../crti.o /usr/lib/gcc-lib/ia64-redhat-linux/2.96/crtbegin.o -L/usr/lib/gcc-lib/ia64-redhat-linux/2.96 -L/usr/lib/gcc-lib/ia64-redhat-linux/2.96/../../.. compiler.o -lgcc -lc -lgcc /usr/lib/gcc-lib/ia64-redhat-linux/2.96/crtend.o /usr/lib/gcc-lib/ia64-redhat-linux/2.96/../../../crtn.o The following is the run of the generated program: [build-hp1] a.out in reply_received: seqno is 0 in reply_received: seqno is 1010101 -- Summary: ia64 gcc with -O2 does not store value in register into local varible Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: czang at panasas dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13028