PR middle-end/38661
* tree-switch-conversion.c (build_constructors): Test for wrapping of
pos case.
2008-12-30 Andrew Pinski <pinskia@gmail.com>
PR middle-end/38661
* gcc.c-torture/compile/pr38661.c: New testcase.
* gcc.c-torture/compile/pr38661-1.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142964
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-12-30 Andrew Pinski <pinskia@gmail.com>
+
+ PR middle-end/38661
+ * tree-switch-conversion.c (build_constructors): Test for wrapping of
+ pos case.
+
2008-12-30 Steven Bosscher <steven@gcc.gnu.org>
PR middle-end/38584
+2008-12-30 Andrew Pinski <pinskia@gmail.com>
+
+ PR middle-end/38661
+ * gcc.c-torture/compile/pr38661.c: New testcase.
+ * gcc.c-torture/compile/pr38661-1.c: New testcase.
+
2008-12-30 Richard Guenther <rguenther@suse.de>
PR middle-end/38564
--- /dev/null
+/* We used to ICE because we would wrap INT_MAX
+ into INT_MIN while doing the switch converison. */
+
+const char *func(int val) {
+ switch (val) {
+ case - __INT_MAX__ -1 : return "foo";
+ default: return "";
+ }
+}
--- /dev/null
+/* We used to ICE because we would wrap INT_MAX
+ into INT_MIN while doing the switch converison. */
+
+const char *func(int val) {
+ switch (val) {
+ case __INT_MAX__: return "foo";
+ default: return "";
+ }
+}
{
gimple phi = gsi_stmt (gsi);
tree val = PHI_ARG_DEF_FROM_EDGE (phi, e);
+ tree low = CASE_LOW (cs);
pos = CASE_LOW (cs);
- while (!tree_int_cst_lt (high, pos))
+ do
{
constructor_elt *elt;
elt->value = val;
pos = int_const_binop (PLUS_EXPR, pos, integer_one_node, 0);
- }
+ } while (!tree_int_cst_lt (high, pos) && tree_int_cst_lt (low, pos));
j++;
}
}