[PATCH, pretty-ipa] Allow unions to be IPA-SRAed
Martin Jambor
mjambor@suse.cz
Wed Mar 18 16:31:00 GMT 2009
Hi,
as requested by Honza, the patch below allows unions to be IPA-SRAed.
I have bootstrapped and tested it on x86_64-linux and will commit it
tomorrow unless someone objects.
Thanks,
Martin
2009-03-18 Martin Jambor <mjambor@suse.cz>
* ipa-sra.c (find_param_candidates): Allow unions to be candidates for
IPA-SRA.
Index: isra/gcc/ipa-sra.c
===================================================================
--- isra.orig/gcc/ipa-sra.c
+++ isra/gcc/ipa-sra.c
@@ -923,28 +923,29 @@ find_param_candidates (void)
tree type;
count++;
-
if (TREE_THIS_VOLATILE (parm))
continue;
type = TREE_TYPE (parm);
-
if (POINTER_TYPE_P (type))
{
type = TREE_TYPE (type);
if ((!is_gimple_reg_type (type)
&& TREE_CODE (type) != RECORD_TYPE
+ && TREE_CODE (type) != UNION_TYPE
+ && TREE_CODE (type) != QUAL_UNION_TYPE
&& TREE_CODE (type) != ARRAY_TYPE)
|| TREE_CODE (type) == FUNCTION_TYPE
|| TYPE_VOLATILE (type))
continue;
}
else if (TREE_CODE (type) != RECORD_TYPE
+ && TREE_CODE (type) != UNION_TYPE
+ && TREE_CODE (type) != QUAL_UNION_TYPE
&& TREE_CODE (type) != ARRAY_TYPE)
continue;
-
if (!COMPLETE_TYPE_P (type)
|| TREE_ADDRESSABLE (type)
|| !host_integerp (TYPE_SIZE (type), 1)
More information about the Gcc-patches
mailing list