This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix 19042
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 Dec 2004 18:38:54 -0800
- Subject: fix 19042
I think this patch is a bit cleaner than dje's patch
attached to the pr.
Tested on i686-linux.
r~
PR tree-opt/19042
* tree-sra.c (decide_block_copy): Force use_block_copy false
for complex values.
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.48
diff -c -p -d -r2.48 tree-sra.c
*** tree-sra.c 22 Dec 2004 18:43:44 -0000 2.48
--- tree-sra.c 1 Jan 2005 02:36:29 -0000
*************** decide_block_copy (struct sra_elt *elt)
*** 1293,1302 ****
tree size_tree = TYPE_SIZE_UNIT (elt->type);
bool use_block_copy = true;
/* Don't bother trying to figure out the rest if the structure is
so large we can't do easy arithmetic. This also forces block
copies for variable sized structures. */
! if (host_integerp (size_tree, 1))
{
unsigned HOST_WIDE_INT full_size, inst_size = 0;
unsigned int inst_count;
--- 1293,1307 ----
tree size_tree = TYPE_SIZE_UNIT (elt->type);
bool use_block_copy = true;
+ /* Tradeoffs for COMPLEX types pretty much always make it better
+ to go ahead and split the components. */
+ if (TREE_CODE (elt->type) == COMPLEX_TYPE)
+ use_block_copy = false;
+
/* Don't bother trying to figure out the rest if the structure is
so large we can't do easy arithmetic. This also forces block
copies for variable sized structures. */
! else if (host_integerp (size_tree, 1))
{
unsigned HOST_WIDE_INT full_size, inst_size = 0;
unsigned int inst_count;