Commit 7f2a9982 by Andrew Pinski Committed by Andrew Pinski

re PR tree-optimization/38661 (ICE: vector VEC(constructor_elt,base) push domain…

re PR tree-optimization/38661 (ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450)

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  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.

From-SVN: r142964
parent 00002090
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> 2008-12-30 Steven Bosscher <steven@gcc.gnu.org>
PR middle-end/38584 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> 2008-12-30 Richard Guenther <rguenther@suse.de>
PR middle-end/38564 PR middle-end/38564
......
/* 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 "";
}
}
/* 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 "";
}
}
...@@ -440,9 +440,10 @@ build_constructors (gimple swtch) ...@@ -440,9 +440,10 @@ build_constructors (gimple swtch)
{ {
gimple phi = gsi_stmt (gsi); gimple phi = gsi_stmt (gsi);
tree val = PHI_ARG_DEF_FROM_EDGE (phi, e); tree val = PHI_ARG_DEF_FROM_EDGE (phi, e);
tree low = CASE_LOW (cs);
pos = CASE_LOW (cs); pos = CASE_LOW (cs);
while (!tree_int_cst_lt (high, pos)) do
{ {
constructor_elt *elt; constructor_elt *elt;
...@@ -452,7 +453,7 @@ build_constructors (gimple swtch) ...@@ -452,7 +453,7 @@ build_constructors (gimple swtch)
elt->value = val; elt->value = val;
pos = int_const_binop (PLUS_EXPR, pos, integer_one_node, 0); 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++; j++;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment