This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/82776] Unable to optimize the loop when iteration count is unavailable.
- From: "amker at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 31 Oct 2017 11:00:25 +0000
- Subject: [Bug tree-optimization/82776] Unable to optimize the loop when iteration count is unavailable.
- Auto-submitted: auto-generated
- References: <bug-82776-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82776
--- Comment #6 from amker at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #5)
> (In reply to amker from comment #4)
> > Well, one decision needs to be made is whether such bound information should
> > be covered by -faggressive-loop-optimizations. We already did this for
> > undefined behavior of sign type and array bound. OTOH, this doesn't look
> > like too aggressive since we already rely on undefined behavior for
> > pointer/signed types in SCEV.
>
> Given:
> if (flag_aggressive_loop_optimizations)
> infer_loop_bounds_from_undefined (loop);
> I think it should be keyed on flag_aggressive_loop_optimizations.
Base IVs are a bit special and different to existing undefined behavior here.
IIUC, non-wrap has been assumed all the places in IV/SCEV analysis and that
information has been used in niter analysis without
flag_aggressive_loop_optimizations already.
> E.g. we want to avoid something like that when sanitizing etc.
>
> > Note I made change assuming non-wrap pointer all the time in r250765, but
> > seems some kernel code depends on that, i.e, PR82694. We may need to revert
> > the change and only assume non-wrap pointer when !flag_wrapv. Thanks.
>
> IMHO the kernel should be fixed, in any case, that is something to discuss
> in that PR, not here.