Hi all,

 After applying patch from 
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00228.html we can
have a negative value in call to TEST_BIT() macro in 
mem_overlaps_already_clobbered_arg_p() function
for stored_args_map bitmap table.
 This can lead to reject a valid tail call optimization.

 This patch will ensure that i+k is positive before calling TEST_BIT() macro.

2012-03-12  Mickael Guene  <mickael.gu...@st.com>

        * calls.c (mem_overlaps_already_clobbered_arg_p): Don't call TEST_BIT 
for
        negative value.

Regards

Mickael
--- a/gcc/calls.c	2012-03-12 10:44:27.000000000 +0100
+++ b/gcc/calls.c	2012-03-12 10:46:16.000000000 +0100
@@ -1822,7 +1822,8 @@
       unsigned HOST_WIDE_INT k;
 
       for (k = 0; k < size; k++)
-	if (i + k < stored_args_map->n_bits
+	if (i + k >= 0
+	    && i + k < stored_args_map->n_bits
 	    && TEST_BIT (stored_args_map, i + k))
 	  return true;
     }

Reply via email to