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]

Re: Reload bug & SRA oddness


On May  6, 2007, Bernd Schmidt <bernds_cb1@t-online.de> wrote:

> Alexandre Oliva wrote:
>> It might make sense to test whether, instead of a DImode variable, a
>> pair of SImode variables would do (i.e., no bit-fields crossing the
>> SImode boundary), as long as registers are known to hold SImode but
>> not DImode.  But is there a generic way to test for such "efficiency
>> boundaries"?

> I'd start with

>   GET_MODE_SIZE (foo) <= UNITS_PER_WORD

> as a first order approximation.

This is sort of equivalent.  Ok to install on top of the other patch?

for gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* tree-sra.c (try_instantiate_multiple_fields): Clip alignment
	at word size.

Index: gcc/tree-sra.c
===================================================================
--- gcc/tree-sra.c.orig	2007-05-06 02:31:43.000000000 -0300
+++ gcc/tree-sra.c	2007-05-06 02:31:44.000000000 -0300
@@ -1486,6 +1486,11 @@ try_instantiate_multiple_fields (struct 
   if (align < alchk)
     align = alchk;
 
+  /* Coalescing wider fields is probably pointless and
+     inefficient.  */
+  if (align > BITS_PER_WORD)
+    align = BITS_PER_WORD;
+
   bit = tree_low_cst (DECL_FIELD_OFFSET (f), 1) * BITS_PER_UNIT
     + tree_low_cst (DECL_FIELD_BIT_OFFSET (f), 1);
   size = tree_low_cst (DECL_SIZE (f), 1);
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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