From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31424 invoked by alias); 12 Oct 2005 15:33:47 -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 31399 invoked by uid 48); 12 Oct 2005 15:33:45 -0000 Date: Wed, 12 Oct 2005 15:33:00 -0000 Subject: [Bug c/24332] New: asm label declaration may be missing aliasing info X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "cbowler at ca dot ibm dot com" X-SW-Source: 2005-10/txt/msg01549.txt.bz2 List-Id: sparky% gcc -v Reading specs from /.../torolab.ibm.com/fs/projects/vabld/run/gcc/aix/gcc-3.3.2/aix52/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/specs Configured with: ../gcc-3.3.2/configure --disable-nls Thread model: aix gcc version 3.3.2 t.c: int j asm("i"); int i; int main() { i = 5; j = 6; int k = i; j = 7; return k; } sparky% gcc t.c sparky% a.out sparky% echo $? 6 sparky% gcc t.c -O sparky% a.out sparky% echo $? 5 In the opt case I expect a result of 6. The problem, I suspect, is that the compiler is not aliasing 'i' and 'j' to each other for the optimizer. The write 'j=6' appears dead in this case, and the optimizer is likely to remove it. You may consider this user error, however, the compiler is able to detect this problem because it knows 'i' and 'j' have the same symbol name. Consequently I suggest either an error diagnostic be issued, or the symbols should be aliased together for the optimizer. -- Summary: asm label declaration may be missing aliasing info Product: gcc Version: 3.3.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cbowler at ca dot ibm dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24332