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: SRA bit-field optimization


On Oct  8, 2007, "John David Anglin" <dave@hiauly1.hia.nrc.ca> wrote:

> Breakpoint 2, simplify_subreg (outermode=SImode, op=0x402e6fd0,
>     innermode=DImode, byte=0) at ../../gcc/gcc/simplify-rtx.c:4920

Ugh.  I had fixed this, but as it turned out, the hunk that fixed it
was included in one patch while the ChangeLog entry was in the other.

The fix for this is already in, in revision 129143.

Here's the patch I actually checked in, with an adjusted ChangeLog
entry.

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

	PR middle-end/22156
	* tree-sra.c (scalarize_lsdt): Fix thinko in testing whether
	the original stmt can throw.
	(sra_build_bf_assignment): Fix type mismatch when applying negated
	mask.

Index: gcc/tree-sra.c
===================================================================
--- gcc/tree-sra.c.orig	2007-10-08 20:54:16.000000000 -0300
+++ gcc/tree-sra.c	2007-10-08 20:54:27.000000000 -0300
@@ -2408,7 +2408,7 @@ sra_build_bf_assignment (tree dst, tree 
       tmp2 = fold_build1 (BIT_NOT_EXPR, utype, mask);
       tmp2 = int_const_binop (RSHIFT_EXPR, tmp2, minshift, true);
       tmp2 = fold_convert (ut, tmp2);
-      tmp2 = fold_build2 (BIT_AND_EXPR, utype, tmp3, tmp2);
+      tmp2 = fold_build2 (BIT_AND_EXPR, ut, tmp3, tmp2);
 
       if (tmp3 != tmp2)
 	{
@@ -3436,7 +3436,7 @@ scalarize_ldst (struct sra_elt *elt, tre
 	{
 	  tree_stmt_iterator tsi;
 	  tree first, blist = NULL;
-	  bool thr = (bsi->bb->flags & EDGE_COMPLEX) != 0;
+	  bool thr = tree_could_throw_p (stmt);
 
 	  /* If the last statement of this BB created an EH edge
 	     before scalarization, we have to locate the first
-- 
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]