OSDN Git Service

PR tree-optimization/33655
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Oct 2007 04:55:17 +0000 (04:55 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Oct 2007 04:55:17 +0000 (04:55 +0000)
PR middle-end/22156
* tree-sra.c (bitfield_overlaps_p): When fld->element is INTEGER_CST,
convert it to bitsizetype before size_binop call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129152 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-sra.c

index d275fbb..03230d1 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-09  James E. Wilson  <wilson@specifix.com>
+
+       PR tree-optimization/33655
+       PR middle-end/22156
+       * tree-sra.c (bitfield_overlaps_p): When fld->element is INTEGER_CST,
+       convert it to bitsizetype before size_binop call.
+
 2007-10-09  Alexandre Oliva  <aoliva@redhat.com>
 
        PR tree-optimization/33572
index f8b4470..21da0c0 100644 (file)
@@ -2906,7 +2906,8 @@ bitfield_overlaps_p (tree blen, tree bpos, struct sra_elt *fld,
   else if (TREE_CODE (fld->element) == INTEGER_CST)
     {
       flen = fold_convert (bitsizetype, TYPE_SIZE (fld->type));
-      fpos = size_binop (MULT_EXPR, flen, fld->element);
+      fpos = fold_convert (bitsizetype, fld->element);
+      fpos = size_binop (MULT_EXPR, flen, fpos);
     }
   else
     gcc_unreachable ();