------- Comment #10 from jamborm at gcc dot gnu dot org  2009-09-08 17:10 
-------
We have talked about this on IRC today and in the end I agreed that
pass_stdarg should be scheduled rather late.  This means that we
probably should return to the old behavior of ignoring va_lists in the
early SRA.

Thus I am now bootstrapping and testing the following patch on
x86_64-linux.  Uros, can you please test it on Alpha?  Thanks.


2009-09-08  Martin Jambor  <mjam...@suse.cz>

        PR tree-optimization/41089
        * tree-sra.c (find_var_candidates): Do not consider va_lists in
        early SRA.

Index: mine/gcc/tree-sra.c
===================================================================
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -1165,7 +1165,13 @@ find_var_candidates (void)
          || !COMPLETE_TYPE_P (type)
          || !host_integerp (TYPE_SIZE (type), 1)
           || tree_low_cst (TYPE_SIZE (type), 1) == 0
-         || type_internals_preclude_sra_p (type))
+         || type_internals_preclude_sra_p (type)
+         /* Fix for PR 41089.  tree-stdarg.c needs to have va_lists intact but
+             we also want to schedule it rather late.  Thus we ignore it in
+             the early pass. */
+         || (sra_mode == SRA_MODE_EARLY_INTRA
+             && (TYPE_MAIN_VARIANT (TREE_TYPE (var))
+                 == TYPE_MAIN_VARIANT (va_list_type_node))))
        continue;

       bitmap_set_bit (candidate_bitmap, DECL_UID (var));


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41089

Reply via email to