https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80548

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Aldy Hernandez from comment #4)
> Created attachment 51908 [details]
> untested patch
> 
> Like this.  It fixes the problem at least for -O2.

For -O1 y'all are on your own because there are no threaders smart enough to
pick up the pattern.

We'd need a threader at -O1 that runs after loop_done to pick it up:

$ ./cc1 a.c -O1 -Wall  -fenable-tree-threadfull2 -quiet
cc1: note: enable pass tree-threadfull2 for functions in the range of [0,
4294967295]
$ 

Voila, no warning.

DOM3 runs after loop_done, so that would be candidate to handle this since it
threads at -O1.  However, this won't happen in this release.  It would require
a converting DOM threading to a hybrid approach (and see if the custom copier
can handle cross-loop threading), or convert it entirely to the backward
threader (would require ranger handling floats).

Reply via email to