From 48acf1b78b128d2cace0705d159db7e2791756cf Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 27 Sep 2011 08:53:08 +0000 Subject: re PR tree-optimization/50363 (internal compiler error: verify_gimple failed) 2011-09-27 Richard Guenther PR tree-optimization/50363 * tree-ssa-pre.c (create_expression_by_pieces): Handle pointer conversions in POINTER_PLUS_EXPRs properly. * gcc.dg/torture/pr50363.c: New testcase. From-SVN: r179247 --- gcc/tree-ssa-pre.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gcc/tree-ssa-pre.c') diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index bee6ef5..5c112c0 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3085,11 +3085,15 @@ create_expression_by_pieces (basic_block block, pre_expr expr, stmts, domstmt); if (!genop[i]) return NULL_TREE; - /* Ensure genop[1] is a ptrofftype for POINTER_PLUS_EXPR. It - may be a constant with the wrong type. */ - if (i == 1 - && nary->opcode == POINTER_PLUS_EXPR) - genop[i] = convert_to_ptrofftype (genop[i]); + /* Ensure genop[] is properly typed for POINTER_PLUS_EXPR. It + may have conversions stripped. */ + if (nary->opcode == POINTER_PLUS_EXPR) + { + if (i == 0) + genop[i] = fold_convert (nary->type, genop[i]); + else if (i == 1) + genop[i] = convert_to_ptrofftype (genop[i]); + } else genop[i] = fold_convert (TREE_TYPE (nary->op[i]), genop[i]); } -- cgit v1.1