OSDN Git Service

2004-10-19 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Oct 2004 20:52:22 +0000 (20:52 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Oct 2004 20:52:22 +0000 (20:52 +0000)
        * tree-cfg.c (group_case_labels): Look at the second to last
        case statement for combing with the default case.

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

gcc/ChangeLog
gcc/tree-cfg.c

index c7616e1..bafae45 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-19  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * tree-cfg.c (group_case_labels): Look at the second to last
+       case statement for combing with the default case.
+
 2004-10-19  Richard Hendeson  <rth@redhat.com>
 
        PR 17962
index 0722df1..1031f91 100644 (file)
@@ -948,7 +948,7 @@ group_case_labels (void)
             Ignore the last element of the label vector because it
             must be the default case.  */
           i = 0;
-         while (i < old_size - 2)
+         while (i < old_size - 1)
            {
              tree base_case, base_label, base_high, type;
              base_case = TREE_VEC_ELT (labels, i);
@@ -969,13 +969,13 @@ group_case_labels (void)
              type = TREE_TYPE (CASE_LOW (base_case));
              base_high = CASE_HIGH (base_case) ?
                CASE_HIGH (base_case) : CASE_LOW (base_case);
-
+             i++;
              /* Try to merge case labels.  Break out when we reach the end
                 of the label vector or when we cannot merge the next case
                 label with the current one.  */
-             while (i < old_size - 2)
+             while (i < old_size - 1)
                {
-                 tree merge_case = TREE_VEC_ELT (labels, ++i);
+                 tree merge_case = TREE_VEC_ELT (labels, i);
                  tree merge_label = CASE_LABEL (merge_case);
                  tree t = int_const_binop (PLUS_EXPR, base_high,
                                            integer_one_node, 1);
@@ -990,6 +990,7 @@ group_case_labels (void)
                      CASE_HIGH (base_case) = base_high;
                      TREE_VEC_ELT (labels, i) = NULL_TREE;
                      new_size--;
+                     i++;
                    }
                  else
                    break;