From 7d5d39bb9dbdf4374f8240128048302338faaca7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 25 Feb 2010 11:41:52 +0100 Subject: re PR debug/43165 (ice in simplify_subreg, at simplify-rtx.c:5146) PR debug/43165 * cfgexpand.c (expand_debug_expr): Don't call simplify_gen_subreg if bitpos isn't multiple of mode's bitsize. * gcc.dg/torture/pr43165.c: New test. From-SVN: r157062 --- gcc/cfgexpand.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/cfgexpand.c') diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index f5677a3..e60df87 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2538,8 +2538,9 @@ expand_debug_expr (tree exp) if (bitpos >= GET_MODE_BITSIZE (opmode)) return NULL; - return simplify_gen_subreg (mode, op0, opmode, - bitpos / BITS_PER_UNIT); + if ((bitpos % GET_MODE_BITSIZE (mode)) == 0) + return simplify_gen_subreg (mode, op0, opmode, + bitpos / BITS_PER_UNIT); } return simplify_gen_ternary (SCALAR_INT_MODE_P (GET_MODE (op0)) -- cgit v1.1