From afe1a916d7e6195a85569d33685fd3259f9a0e84 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 5 Jan 2007 21:04:23 +0000 Subject: re PR c++/27826 (ICE in copy_to_mode_reg) 2007-01-05 Richard Guenther PR middle-end/27826 * tree.c (get_narrower): Do not construct COMPONENT_REFs with mismatched types. Instead explicitly build a conversion NOP_EXPR. * g++.dg/opt/pr27826.C: New testcase. From-SVN: r120498 --- gcc/tree.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gcc/tree.c') diff --git a/gcc/tree.c b/gcc/tree.c index 5abd6f3..71d221e 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5989,12 +5989,10 @@ get_narrower (tree op, int *unsignedp_ptr) { if (first) uns = DECL_UNSIGNED (TREE_OPERAND (op, 1)); - win = build3 (COMPONENT_REF, type, TREE_OPERAND (op, 0), - TREE_OPERAND (op, 1), NULL_TREE); - TREE_SIDE_EFFECTS (win) = TREE_SIDE_EFFECTS (op); - TREE_THIS_VOLATILE (win) = TREE_THIS_VOLATILE (op); + win = fold_convert (type, op); } } + *unsignedp_ptr = uns; return win; } -- cgit v1.1