From c7b38a8574b6b442b78e40256022ce419ca2eb04 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 17 Nov 2006 09:57:45 +0100 Subject: re PR middle-end/29584 (internal compiler error on optimization) PR middle-end/29584 * tree-ssa-forwprop.c (simplify_switch_expr): Don't optimize if DEF doesn't have integral type. * gcc.dg/torture/pr29584.c: New test. From-SVN: r118921 --- gcc/tree-ssa-forwprop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/tree-ssa-forwprop.c') diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index e2c5ed4..a3caf23 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -934,7 +934,9 @@ simplify_switch_expr (tree stmt) need_precision = TYPE_PRECISION (ti); fail = false; - if (TYPE_UNSIGNED (to) && !TYPE_UNSIGNED (ti)) + if (! INTEGRAL_TYPE_P (ti)) + fail = true; + else if (TYPE_UNSIGNED (to) && !TYPE_UNSIGNED (ti)) fail = true; else if (!TYPE_UNSIGNED (to) && TYPE_UNSIGNED (ti)) need_precision += 1; -- cgit v1.1