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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-04-15
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Generally loop optimizers are bad when handling debug info, most
of the time dropping them on the floor rather than changing them to resets.
In this particular case it's loop distribution:

@@ -16,33 +25,7 @@
   # DEBUG i => 0
   # DEBUG BEGIN_STMT
   # DEBUG i => 0
-
-  <bb 3> [local count: 719407024]:
-  # i_14 = PHI <0(2), i_8(5)>
-  # ivtmp_4 = PHI <7(2), ivtmp_1(5)>
-  # DEBUG c => NULL
-  # DEBUG i => NULL
-  # DEBUG i => i_14
-  # DEBUG c => NULL
-  # DEBUG c => 0
-  # DEBUG BEGIN_STMT
-  b[i_14][0] = 0;
-  # DEBUG c => 1
-  # DEBUG c => NULL
-  # DEBUG c => 1
-  i_8 = i_14 + 1;
-  # DEBUG i => i_8
-  # DEBUG i => i_8
-  ivtmp_1 = ivtmp_4 - 1;
-  if (ivtmp_1 != 0)
-    goto <bb 5>; [0.00%]
-  else
-    goto <bb 4>; [100.00%]
-
-  <bb 5> [local count: 0]:
-  goto <bb 3>; [100.00%]
-
-  <bb 4> [local count: 719407023]:
+  __builtin_memset (&b, 0, 14);
   # DEBUG BEGIN_STMT
   optimize_me_not ();


it's not "easy" to fix things up here, but loop-distribution uses
delete_basic_block and edge redirection which bypasses CFG cleanup
ability to eventually handle this better.

I have a patch.

Reply via email to