[Bug optimization/13552] New: gcc 'optimizes' position of label
jbemmel at zonnet dot nl
gcc-bugzilla@gcc.gnu.org
Sat Jan 3 01:45:00 GMT 2004
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
More information about the Gcc-bugs
mailing list