]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ebitmap.h (ebitmap_iter_init): Initialize all fields.
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 16 Jan 2009 20:44:25 +0000 (20:44 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 16 Jan 2009 20:44:25 +0000 (20:44 +0000)
* ebitmap.h (ebitmap_iter_init): Initialize all fields.
* ipa-struct-reorg.c (gen_struct_type): Replace known-true
test with assertion.

From-SVN: r143443

gcc/ChangeLog
gcc/ebitmap.h
gcc/ipa-struct-reorg.c

index f3c186ee1d7673ca55941dd9329346ecae8caf7f..77cf99cb6dde73128b69b24d3f21d95e39fd9709 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-16  Alexandre Oliva  <aoliva@redhat.com>
+
+       * ebitmap.h (ebitmap_iter_init): Initialize all fields.
+       * ipa-struct-reorg.c (gen_struct_type): Replace known-true
+       test with assertion.
+
 2009-01-16  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38835
index 2916e44b223b979592dda5c74195964ffdd82894..f2f2b705e89099408908174e2aae52b2965d9ae1 100644 (file)
@@ -1,5 +1,5 @@
 /* Sparse array based bitmaps.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -95,7 +95,13 @@ ebitmap_iter_init (ebitmap_iterator *i, ebitmap bmp, unsigned int min)
                     min / EBITMAP_ELT_BITS);
   i->size = bmp->numwords;
   if (i->size == 0)
-    return;
+    {
+      i->ptr = NULL;
+      i->eltnum = 0;
+      i->bit_num = 0;
+      i->word = 0;
+      return;
+    }
   i->ptr = bmp->elts;
   i->bit_num = min;
   i->eltnum = 0;
index d1d7b1ca969d2e8cc61cb9d44cbb5994dad6e93d..cde905e35ccbad45f6b58f7c46df1046a5c7dcda 100644 (file)
@@ -1865,8 +1865,9 @@ gen_struct_type (tree decl, tree new_str_type)
          wr.wrap = 0;
          wr.domain = NULL_TREE;
        }
-      else if (TREE_CODE (type_orig) == ARRAY_TYPE)
+      else
        {
+         gcc_assert (TREE_CODE (type_orig) == ARRAY_TYPE);
          wr.wrap = 1;
          wr.domain = TYPE_DOMAIN (type_orig);
        }