summaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@gmail.com>2008-12-30 08:27:29 -0800
committerAndrew Pinski <pinskia@gcc.gnu.org>2008-12-30 08:27:29 -0800
commit7f2a9982659c7963ff213722e1feabbd7563118e (patch)
treee674523d6521e2e5ad5b3539aabdd14810d1673a /gcc/tree-switch-conversion.c
parent000020907344fccdd11036944874d80d137557df (diff)
downloadgcc-7f2a9982659c7963ff213722e1feabbd7563118e.tar.gz
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
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r--gcc/tree-switch-conversion.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 798cf161569..dba0c6f3de3 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -440,9 +440,10 @@ build_constructors (gimple swtch)
{
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;
@@ -452,7 +453,7 @@ build_constructors (gimple swtch)
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++;
}
}