aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-01-05 21:04:23 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-01-05 21:04:23 +0000
commitafe1a916d7e6195a85569d33685fd3259f9a0e84 (patch)
tree319f79245605fcdcdd74c51918fbb1d8f483304d /gcc/tree.c
parentee167bcb2d2382cf9f64d84ac9630176a8deac8f (diff)
downloadgcc-afe1a916d7e6195a85569d33685fd3259f9a0e84.zip
gcc-afe1a916d7e6195a85569d33685fd3259f9a0e84.tar.gz
gcc-afe1a916d7e6195a85569d33685fd3259f9a0e84.tar.bz2
re PR c++/27826 (ICE in copy_to_mode_reg)
2007-01-05 Richard Guenther <rguenther@suse.de> 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
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c6
1 files changed, 2 insertions, 4 deletions
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;
}