stabilize switch labels for -fcompare-debug in vrp

Alexandre Oliva aoliva@redhat.com
Mon Oct 11 13:14:00 GMT 2010


i386.c fails -fcompare-debug at -O3 because label half: in
ix86_expand_vector_init_general gets the DECL_UIDs of labels sorted
differently by the tree-vrp sort function.

As a result, different SSA_NAMEs are used for the assert variables in
different cases of the switch.  At the end of VRP, they're released, and
put in the freelist in different order.  At a later pass, the SSA_NAME
nodes are reused in a different order, and we go down the hill from
there, because different version numbers cause other optimization
differences.

Using LABEL_DECL_UIDs instead of DECL_UIDs gets us a stable sort.  I
haven't figured out why the named label got a different UID.  I only
observed this in the 4.5 branch, but the same patch applies cleanly in
the trunk, and I regstrapped the patch on both trees, on x86 and on
x86_64.

Ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vta-vrp-label-decl-uid.patch
Type: text/x-diff
Size: 762 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101011/437d4d32/attachment.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