
Untitled
By: a guest on
Aug 11th, 2012 | syntax:
None | size: 0.61 KB | hits: 8 | expires: Never
What is the specific GCC flag that turns on immediate value propagation for inline assembly parameters?
#include <stdlib.h>
static int i;
static inline __attribute__((always_inline)) test(int x)
{
asm volatile("mov %1, %0" : "=r"(i): "i"(x));
}
int main(void)
{
test(5);
return i;
}
gcc -O test.c
gcc test.c
void foo (void)
{
int i = 6;
asm volatile ("" : : "i" (i));
}
gcc -ftree-ter test.c # no errors
alw.c: In function ‘main’:
alw.c:7:5: warning: asm operand 1 probably doesn’t match constraints [enabled by default]
alw.c:7:5: error: impossible constraint in ‘asm’