]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR middle-end/53245
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 May 2012 14:40:33 +0000 (14:40 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 May 2012 14:40:33 +0000 (14:40 +0000)
* gimplify.c (preprocess_case_label_vec_for_gimple): If low or high
is folded to a type boundary value, verify that the resulting case
label is still a care range.

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

gcc/ChangeLog
gcc/gimplify.c

index 133719b3387b8cadb8c5672d5ab4fb31f0885146..33aae8a11d85c7b4595cff90dca28786b1aa4a41 100644 (file)
@@ -1,3 +1,10 @@
+2012-05-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR middle-end/53245
+       * gimplify.c (preprocess_case_label_vec_for_gimple): If low or high
+       is folded to a type boundary value, verify that the resulting case
+       label is still a care range.
+
 2012-05-07  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (ctz<mode>2): Emit rep;bsf
index d7cbc2489a1b00139f415cdae873892e6101d8f0..74d7895020315aa2b0991783a595b9a1952755e0 100644 (file)
@@ -1658,6 +1658,10 @@ preprocess_case_label_vec_for_gimple (VEC(tree,heap) *labels,
                      && tree_int_cst_compare (high, max_value) > 0)
                    high = max_value;
                  high = fold_convert (index_type, high);
+
+                 /* We may have folded a case range to a one-value case.  */
+                 if (tree_int_cst_equal (low, high))
+                   high = NULL_TREE;
                }
            }