This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR tree-optimize/19042 Scalarize complex types
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Dec 2004 21:44:36 -0500
- Subject: [PATCH] PR tree-optimize/19042 Scalarize complex types
The general consensus on IRC was that complex types should be
scalarized. decide_block_copy was not checking for complex types and the
other heuristics sometimes missed them, so a patch is appended.
Okay for mainline?
David
* tree-sra.c (decide_block_copy): Try to use element copy for
complex types.
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.47
diff -c -p -r2.47 tree-sra.c
*** tree-sra.c 10 Dec 2004 21:54:42 -0000 2.47
--- tree-sra.c 17 Dec 2004 02:35:33 -0000
*************** decide_block_copy (struct sra_elt *elt)
*** 1316,1324 ****
is much more of a factor. */
/* If the structure is small, and we've made copies, go ahead
! and instantiate, hoping that the copies will go away. */
! if (full_size <= max_size
! && elt->n_copies > elt->n_uses)
use_block_copy = false;
else
{
--- 1316,1325 ----
is much more of a factor. */
/* If the structure is small, and we've made copies, go ahead
! and instantiate, hoping that the copies will go away.
! Always instantiate complex types. */
! if ((full_size <= max_size && elt->n_copies > elt->n_uses)
! || TREE_CODE (elt->type) == COMPLEX_TYPE)
use_block_copy = false;
else
{