This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, PR 41089] Do not scalarize va_lists in early SRA
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Guenther <rguenther at suse dot de>, ubizjak at gmail dot com, jakub at gcc dot gnu dot org
- Date: Wed, 9 Sep 2009 18:21:02 +0200
- Subject: [PATCH, PR 41089] Do not scalarize va_lists in early SRA
Hi,
if va_lists are SRAed in early SRA, tree-stdarg.c pass cannot process
them. We want to run the tree stdarg pass rather late (after DCE at
least) and so we decided to make early SRA skip the va_list
structures.
Uros reported that this fixes some but not all alpha stdarg failures,
there is still one execution test failing and one dump match not
matching. However, if I managed to cross-compile it correctly, no SRA
does anything at all in the execution testcase and similarly the early
SRA does nothing in the dump scan testcase (late SRA happens once but
it is too late to affect the dump).
I have bootstrapped and tested this on x86_64-linux and Uros did some
testing on Alpha. OK for trunk?
Thanks,
Martin
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.
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));