extern struct { int a, b, c, d; } v; extern int w; void foo (void) { int e1 = v.a; int e2 = w; int e3 = v.b; int e4 = v.c; int e5 = v.d; __asm__ volatile ("/* %0 %1 %2 %3 %4 */" : : "nro" (e1), "nro" (e2), "nro" (e3), "nro" (e4), "nro" (e5)); }
with -O2 -m32 gives: xlog.i: In function 'foo': xlog.i:12:3: error: 'asm' operand requires impossible reload xlog.i:12:3: error: 'asm' operand requires impossible reload With "nro" is replaced with "nrm", it compiles fine (but, GCC except for latest trunk might put there side-effects into the unused operand). With "nrm<>" (which is wrong in this case, the asm would actually need to do ld%U1 %0,%1 or something similar, but then would be valid) it dies with similar error. It seems that before reload only when "nrm" is used the asm has (mem (lo_sum (reg) (symbol_ref))) or (mem (plus (reg) (const_int))) but with "nro" or "nrm<>" it contains bare (mem (symbol_ref)) or (mem (plus (symbol_ref) (const_int))) and apparently reload isn't able to deal with that. Not sure if it is a target powerpc bug, or reload bug, or both. In any case, there shouldn't be anything impossible here to reload. I see the ICEs with GCC 4.1, 4.4 and 4.6, so perhaps it is not a regression. -- Summary: operand requires impossible reload Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org GCC target triplet: powerpc-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707