This is the mail archive of the 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" <> 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

for  gcc/ChangeLog
from  Alexandre Oliva  <>

	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

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
FSF Latin America Board Member
Red Hat Compiler Engineer   aoliva@{,}
Free Software Evangelist  oliva@{,}

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