[committed] Fix typo/thinko in recent tree-ssa-dse.c change

Message ID 07e9e5bb-61c7-d893-3c4f-3659d14a3c33@redhat.com
State New
Headers show
  • [committed] Fix typo/thinko in recent tree-ssa-dse.c change
Related show

Commit Message

Jeff Law July 17, 2018, 11:58 p.m.
I meant to mask off low bits in the head trim and wrote...

-    *trim_head &= (UNITS_PER_WORD - 1);

Which, of course is wrong as it's missing the bit-not.

This led to a regression on at least one 32bit target for pr30375's

This patch adds the missing bit-not.  It fixes the regression on i686.
I was briefly worried because a couple of libgomp tests failed.  But
after deeper investigation it turns out they can fail due to resource
limitations.  I re-ran those tests independently and with a much lower
parallelism factor and they all passed.

Installed on the trunk after bootstrapping x86_64 and regression testing
x86_64 and the -m32 multilib.



diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index ebc4a1e..4cb8c0f8 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -260,7 +260,7 @@  compute_trims (ao_ref *ref, sbitmap live, int *trim_head, int *trim_tail,
   /* If more than a word remains, then make sure to keep the
      starting point at least word aligned.  */
   if (last_live - first_live > UNITS_PER_WORD)
-    *trim_head &= (UNITS_PER_WORD - 1);
+    *trim_head &= ~(UNITS_PER_WORD - 1);
   if ((*trim_head || *trim_tail)
       && dump_file && (dump_flags & TDF_DETAILS))