Fixed bug when duplicating empty basic blocks.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Sat, 14 Aug 2010 01:59:36 +0000 (21:59 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Sat, 14 Aug 2010 01:59:36 +0000 (21:59 -0400)
src/aop-duplicate.c

index 5cd2fd8cf5f13accba56dbda47041dd82824cc6b..89d6d57f91e79d88c2981f7636100ca6f9011aac 100644 (file)
@@ -187,12 +187,12 @@ duplicate_function_body (const char *tmpvar_name, gimple call)
       last_bb = pair_p->new;
 
       old_first_stmt = first_stmt (pair_p->old);
-      aop_assert (old_first_stmt != NULL);
 
       /* duplicate_block() does not copy initial labels.  Calling
         gimple_block_label() on the duplicated block will create the
         label for us. */
-      if (gimple_code (old_first_stmt) == GIMPLE_LABEL)
+      if (old_first_stmt != NULL
+         && gimple_code (old_first_stmt) == GIMPLE_LABEL)
        {
          label_pair lblpair;
          lblpair.old = gimple_block_label (pair_p->old);
@@ -218,7 +218,6 @@ duplicate_function_body (const char *tmpvar_name, gimple call)
        {
          gsi_next (&gsi);
        }
-      gcc_assert(!gsi_end_p(gsi));
 
       for (; !gsi_end_p (gsi); gsi_next (&gsi))
        {