[PR debug/46931] don't crash propagating removed DEFs into debug stmts

Richard Guenther richard.guenther@gmail.com
Wed Dec 22 13:42:00 GMT 2010


On Wed, Dec 22, 2010 at 4:54 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Dec 21, 2010, Alexandre Oliva <aoliva@redhat.com> wrote:
>
>> The is_gimple_min_invariant() test was a last-minute thought that was
>> supposed to be extended so as to handle the case at hand but not other
>> expressions that can't be moved about, but that I forgot about before
>> testing and posting the patch.  Oops ;-)
>
> Here's a revised version.  Regression-tested on x86_64-linux-gnu after
> bootstrap with BOOT_CFLAGS='-O2 -g -ftree-vectorize'.

Hm.  I don't like the awkward flow of operation in your change.  We
on purpose created debug temps for multiple uses to avoid memory
growth.  So, the if (value_unshare) code in the loop adjusting the
uses should go before that loop and unconditionally create a
debug temporary (and thus doesn't need unsharing either).

In fact - for the case of removed statements we simply should
insert the debug temp at the immediate common dominator of
all uses.  Or without implementing this, can't we avoid this in
the simple-DCE code instead?  Like with

Index: tree-vect-loop-manip.c
===================================================================
--- tree-vect-loop-manip.c	(revision 167471)
+++ tree-vect-loop-manip.c	(working copy)
@@ -1442,6 +1442,9 @@
   if (update_first_loop_count)
     slpeel_make_loop_iterate_ntimes (first_loop, first_niters);

+  BITMAP_FREE (definitions);
+  delete_update_ssa ();
+
   /* Remove all pattern statements from the loop copy.  They will confuse
      the expander if DCE is disabled.
      ???  The pattern recognizer should be split into an analysis and
@@ -1451,9 +1454,6 @@

   adjust_vec_debug_stmts ();

-  BITMAP_FREE (definitions);
-  delete_update_ssa ();
-
   return new_loop;
 }


That completely should avoid the names-to-rename issue and I'd be much
more happy with the above for 4.6.

Richard.


>
>
> --
> 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 Brazil Compiler Engineer
>
>



More information about the Gcc-patches mailing list