This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13552] New: gcc 'optimizes' position of label
- From: "jbemmel at zonnet dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jan 2004 01:45:20 -0000
- Subject: [Bug optimization/13552] New: gcc 'optimizes' position of label
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compile this code, with or without '-Os' flag:
#include <string.h>
static int initialStack[1024];
void f()
{
memcpy( initialStack, &&stackcode, 16 );
__asm__ volatile ( "jmp *%0" : : "r"(initialStack) : "memory" );
stackcode:
__asm__ volatile ( "movl %0, %%cr3" : : "a"(0) : "memory" );
}
In the assembly listing generated with '-Os' the stackcode label (L2) is moved
to the beginning of the function, instead of the 'movl %0, %%cr3' instruction.
Without '-Os' it works as expected
--
Summary: gcc 'optimizes' position of label
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbemmel at zonnet dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: 3.3.1 (mingw32 special 20030804-1)
GCC target triplet: 3.3.1 (mingw32 special 20030804-1)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13552