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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com,
                   |                            |siddhesh at gcc dot gnu.org

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
[Siddhesh, I don't know if this is something you're looking at.  If not, feel
free to unsubscribe.]

This may have first been visible with r12-4698-gf6d012338bf87f42, but it isn't
threader related as it can be reproduced with -fno-thread-jumps.

I can actually reproduce it without VRP[12] (but not without evrp).

+ ./cc1 a.c -fdump-tree-all-details -quiet -I/tmp -O2 -fpeel-loops -fwrapv
-fno-thread-jumps -fdisable-tr
ee-vrp2 -fdisable-tree-vrp1
cc1: note: disable pass tree-vrp2 for functions in the range of [0, 4294967295]
cc1: note: disable pass tree-vrp1 for functions in the range of [0, 4294967295]
a.c: In function ‘inetnot’:
a.c:12:14: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
etc
etc

Disabling evrp causes the problem to go away, but all these middle end warnings
are very sensitive to better ranges, so who knows.

For that matter, the only transformation evrp is doing is correct:

@@ -74,7 +90,7 @@
   <bb 9> :
   # nb_8 = PHI <iftmp.0_9(7), nb_23(8)>
   nb_23 = nb_8 + -1;
-  if (nb_8 > 0)
+  if (nb_8 != 0)
     goto <bb 8>; [INV]
   else
     goto <bb 10>; [INV]

...which is merely changing the conditional in the decreasing loop from > 0
into != 0.

It looks like a problem elsewhere.

Reply via email to