* Missing pointer dereference in tree-affine.c
@ 2016-05-05 14:19 Richard Sandiford
2016-05-06 10:41 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2016-05-05 14:19 UTC (permalink / raw)
To: gcc-patches
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. OK to install?
Thanks,
Richard
gcc/
* tree-affine.c (wide_int_constant_multiple_p): Add missing
pointer dereference.
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 32f2301..4884241 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Missing pointer dereference in tree-affine.c
2016-05-05 14:19 Missing pointer dereference in tree-affine.c Richard Sandiford
@ 2016-05-06 10:41 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-05-06 10:41 UTC (permalink / raw)
To: GCC Patches, richard.sandiford
On Thu, May 5, 2016 at 4:19 PM, Richard Sandiford
<richard.sandiford@arm.com> wrote:
> 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. OK to install?
Ok.
Richard.
> Thanks,
> Richard
>
>
> gcc/
> * tree-affine.c (wide_int_constant_multiple_p): Add missing
> pointer dereference.
>
> diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
> index 32f2301..4884241 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;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-06 10:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-05 14:19 Missing pointer dereference in tree-affine.c Richard Sandiford
2016-05-06 10:41 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).