From c2953725717c182dbc606bf9454af29e30918ccf Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sun, 18 Sep 2005 14:15:19 +0000 Subject: re PR middle-end/23944 (segv in fold_indirect_ref_1 in fold-const.c:11505) 2005-09-18 Richard Guenther PR middle-end/23944 * gimplify.c (fold_indirect_ref_rhs): Fix thinko in fallback. * gcc.c-torture/compile/pr23944.c: New testcase. From-SVN: r104402 --- gcc/gimplify.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index cdb8a33..cba1704 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -2950,9 +2950,10 @@ fold_indirect_ref_rhs (tree t) { tree type_domain; tree min_val = size_zero_node; + tree osub = sub; sub = fold_indirect_ref_rhs (sub); if (! sub) - sub = build1 (INDIRECT_REF, TREE_TYPE (subtype), sub); + sub = build1 (INDIRECT_REF, TREE_TYPE (subtype), osub); type_domain = TYPE_DOMAIN (TREE_TYPE (sub)); if (type_domain && TYPE_MIN_VALUE (type_domain)) min_val = TYPE_MIN_VALUE (type_domain); -- cgit v1.1