[PR83422] SFN: don't drop markers for skipping var-tracking

Alexandre Oliva aoliva@redhat.com
Tue Dec 19 17:53:00 GMT 2017


Although debug markers are more useful when bind stmts are placed
among them, there is value in keeping them even when VTA limits are
exceeded.

Regstrapped on x86_64- and i686-linux-gnu.  Preapproved by Jakub in the
PR.  Installed.

for  gcc/ChangeLog

	PR debug/83422
	* var-tracking.c (vt_debug_insns_local): Do not drop markers.
	(variable_tracking_main_1): Keep markers even when VTA fails.

for  gcc/testsuite/ChangeLog

	PR debug/83422
	* gcc.dg/pr83422.c: New.
---
 gcc/testsuite/gcc.dg/pr83422.c |    9 +++++++++
 gcc/var-tracking.c             |    9 ++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/pr83422.c

diff --git a/gcc/testsuite/gcc.dg/pr83422.c b/gcc/testsuite/gcc.dg/pr83422.c
new file mode 100644
index 000000000000..adbf7599d885
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr83422.c
@@ -0,0 +1,9 @@
+/* PR debug/83422 */
+/* { dg-do compile } */
+/* { dg-options "-O -g --param=max-vartrack-size=1" } */
+
+int
+foo(int i, int j, int k)
+{
+   return i + j + k;
+}
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index aa8a605b772f..4a96a039d14b 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -10338,12 +10338,9 @@ delete_vta_debug_insns (void)
    handled as well..  */
 
 static void
-vt_debug_insns_local (bool skipped)
+vt_debug_insns_local (bool skipped ATTRIBUTE_UNUSED)
 {
-  /* ??? Just skip it all for now.  If we skipped the global pass,
-     arrange for stmt markers to be dropped as well.  */
-  if (skipped)
-    cfun->debug_nonbind_markers = 0;
+  /* ??? Just skip it all for now.  */
   delete_vta_debug_insns ();
 }
 
@@ -10445,8 +10442,6 @@ variable_tracking_main_1 (void)
     {
       vt_finalize ();
 
-      cfun->debug_nonbind_markers = 0;
-
       delete_vta_debug_insns ();
 
       /* This is later restored by our caller.  */


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer



More information about the Gcc-patches mailing list