[PATCH] Reduce multiple_of_p uses
Richard Biener
rguenther@suse.de
Mon Jan 31 08:08:01 GMT 2022
On Fri, 28 Jan 2022, Jeff Law wrote:
>
>
> On 1/24/2022 7:45 AM, Richard Biener via Gcc-patches wrote:
> > There are a few cases where we know we're dealing with (poly-)integer
> > constants, so remove the use of multiple_of_p in those cases to make
> > the PR100499 fix less impactful.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu.
> >
> > OK?
> >
> > Thanks,
> > Richard.
> >
> > 2022-01-24 Richard Biener <rguenther@suse.de>
> >
> > PR tree-optimization/100499
> > * tree-cfg.cc (verify_gimple_assign_ternary): Use multiple_p
> > on poly-ints instead of multiple_of_p.
> > * tree-ssa.cc (maybe_rewrite_mem_ref_base): Likewise.
> > (non_rewritable_mem_ref_base): Likewise.
> > (non_rewritable_lvalue_p): Likewise.
> > (execute_update_addresses_taken): Likewise.
> So it's not a full fix for this class of problems, but removes some of the
> cases where we could potentially overflow and give the wrong result. I'd be
> happier if we had a concrete testcase for these instances you're fixing, but I
> think it's a move in the right direction and I obviously trust your judgment
> on whether or not to install it now or wait for gcc-13.
No, multiple_of_p has no issues with these cases since we only ever pass
it [POLY_]INT_CSTs, it's just that there's no need to use multiple_of_p
since we have a better tool for these cases (and thus later do not have
to decide whether to use the no-wrap or wrap variant).
> So your call. Both on whether or not to try and construct testcases to
> trigger these instances and whether or not to install now or wait for gcc-13.
I've pushed it now.
Richard.
More information about the Gcc-patches
mailing list