Missing pointer dereference in tree-affine.c
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 9 May 2016 15:29:03 +0000 (15:29 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 9 May 2016 15:29:03 +0000 (15:29 +0000)
wide_int_constant_multiple_p used:

          if (*mult_set && mult != 0)
            return false;

to check whether we had previously seen a nonzero multiple, but "mult" is
a pointer to the previous value rather than the previous value itself.

Noticed by inspection while working on another patch, so I don't have a
testcase.  I tried adding an assert for combinations that were wrongly
rejected before but it didn't trigger during a bootstrap and regtest.

Tested on x86_64-linux-gnu.

gcc/
* tree-affine.c (wide_int_constant_multiple_p): Add missing
pointer dereference.

From-SVN: r236040

gcc/ChangeLog
gcc/tree-affine.c

index c303b94b900225f6cbc989793bd425179c645fe2..85f0e6738f68021af4b6e396e1f291a32c2903b0 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-09  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-affine.c (wide_int_constant_multiple_p): Add missing
+       pointer dereference.
+
 2016-05-09  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/70985
index 32f2301337439de2ffb0f56176e09adf6c0dd538..4884241134a7faa0f069a0470ba5ea769d3ddd44 100644 (file)
@@ -769,7 +769,7 @@ wide_int_constant_multiple_p (const widest_int &val, const widest_int &div,
 
   if (val == 0)
     {
-      if (*mult_set && mult != 0)
+      if (*mult_set && *mult != 0)
        return false;
       *mult_set = true;
       *mult = 0;