C++: -fvtable-gc and -fforce-addr don't go well together

Hans-Peter Nilsson hp@axis.com
Fri Sep 1 06:41:00 GMT 2000


For example, add -fforce-addr to
testsuite/g++.old-deja/g++.other/crash18.C, and you'll see
an error "inconsistent operand constraints in an `asm'",
preceded by "warning: asm operand 0 probably doesn't match
constraints", since the first operand of the synthesized asm is
forced to a register.
(If you add -O2, there's only a warning; it seems to be "forced
back" to a symbol later, at least for i686-pc-linux-gnu.)

I'd like to fix this, but I don't know if it's
expand_asm_operands that needs to be tweaked (like adjusting
arguments to expand_expr for the "s" constraint), or if the
synthesized asm needs to be tweaked at the time it's generated
(in build_vtable_entry_ref), or perhaps something else.
Perhaps there are missing infrastructure bits for keeping
symbolic addresses, regardless of validity as "normal" insn
operands.

Helpful hints?

brgds, H-P


More information about the Gcc-bugs mailing list