[PR42977, VTA] stabilize cselib's remove_useless_values calls over -g

Alexandre Oliva aoliva@redhat.com
Tue Mar 30 09:29:00 GMT 2010


Debug insns in sched2 (and possibly elsewhere) get cselib to
garbage-collect useless values at different points, leading to
scheduling differences.

This patch keeps separate counts of useless debug and nondebug values,
switching debug to nondebug values upon the first nondebug use.  It also
counts debug values, so that they can be discounted from the number of
elements in the cselib hash table.

It turned out that this wasn't enough to call remove_useless_values() at
the same points, because n_deleted elements are still counted in
n_elements, so when we deleted debug values, element counts would go out
of sync.  I fixed this by discounting n_deleted from n_elements in the
test that guards the remove_useless_values() call.

I had to back to r156515 to duplicate the problem and verify that the
patch fixed it.  The bug is quite sensitive to codegen variations, and
the given testcase, in addition to no longer triggering the bug, is
probably too large for the testsuite.

Regstrapping on x86_64-linux-gnu and i686-linux-gnu.  Ok if it passes?

I also enclose a second patch, that is equivalent, but that applies on
top of http://gcc.gnu.org/ml/gcc-patches/2010-03/msg01038.html, which is
still pending review.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vta-cselib-hide-debug-pr42977-noautoinc.patch
Type: text/x-diff
Size: 14964 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100330/38b8c855/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vta-cselib-hide-debug-pr42977.patch
Type: text/x-diff
Size: 15356 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100330/38b8c855/attachment-0001.bin>
-------------- next part --------------

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer


More information about the Gcc-patches mailing list