This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, pretty-ipa] Allow unions to be IPA-SRAed


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]