http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52172

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-13 
20:26:58 UTC ---
Created attachment 26654
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26654
vartrack.ii

Slightly reduced testcase.
Reproduceable with
./g++ -B ./ -S -fcompare-debug -g -O2 -fno-exceptions -fno-rtti -pedantic
-fno-common vartrack.ii  --param min-nondebug-insn-uid=10000
(the param in order to make the debugging at least bearable by making the uids
match for non-debug insns).

The problem seems to be in remove_useless_values happening at different times
during sched2 (part of ia64 mach pass).  There we for a DEBUG_INSN insn do
first cselib_lookup_from_insn (... , insn), then call cselib_subst_to_values.
Unfortunately the latter means cselib_current_insn is NULL and
promote_debug_loc decides to promote it (and clear setting_insn) even for a
debug stmt value that -g0 compilation doesn't touch in any way.

Reply via email to