2009-09-09 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Sep 2009 16:50:15 +0000 (16:50 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Sep 2009 16:50:15 +0000 (16:50 +0000)
PR tree-optimization/41089
* tree-sra.c (find_var_candidates): Do not consider va_lists in
early SRA.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151566 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-sra.c

index 22c9264..ac2cded 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-09  Martin Jambor  <mjambor@suse.cz>
+
+       PR tree-optimization/41089
+       * tree-sra.c (find_var_candidates): Do not consider va_lists in
+       early SRA.
+
 2009-09-09  Richard Henderson  <rth@redhat.com>
 
        * gimple.h (CASE_GIMPLE_OMP): New.
index 431c456..1a0622e 100644 (file)
@@ -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));