diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-05-09 15:29:03 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2016-05-09 15:29:03 +0000 |
commit | 9f0d00a4263289606e55641297e2d5897d92a1e0 (patch) | |
tree | 2054e2e06c427a113b32bb3fab8c101e2ea3aa4d | |
parent | 732a62420d95d55576066b78a289138149f6524b (diff) |
Missing pointer dereference in tree-affine.c
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@236040 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-affine.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c303b94b900..85f0e6738f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c index 32f23013374..4884241134a 100644 --- a/gcc/tree-affine.c +++ b/gcc/tree-affine.c @@ -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; |