Shared rtx error with GCC 4.5.0

Gunther Nikl gnikl@users.sourceforge.net
Mon May 3 16:11:00 GMT 2010


Hello!

While using a GCC 4.5 snapshot the compiler suddenly emitted
an error message from emit-rtl.c about a "shared rtx". This
error pointed to an instruction I added to the prologue. Now
I checked with 4.5.0 final and it compiles without this error
message. Since a release has checking disabled, I rebuilt the
compiler with "misc,assert" and then 4.5.0-release barfs with
the "shared rtx" message. This is surprising for me since if
there really is a problem with the added code, 4.5.0-release
should catch it as well because emit-rtl.c has a gcc_assert
that checks the very same condition that the ENABLE_CHECKING
code there is testing. This is the added code which causes
the error message:

  ref = gen_rtx_SYMBOL_REF (Pmode, "symbol"]);
  insn = gen_elf_high (reg, ref);
  emit_insn (insn);
  emit_insn (gen_rtx_USE (VOIDmode, insn));
  insn = gen_elf_low (reg, reg, ref);
  emit_insn (insn);
  emit_insn (gen_rtx_USE (VOIDmode, insn));


The error message is issued for the rtx_USE instruction(s).

Regards,
Gunther Nikl



More information about the Gcc-help mailing list