From: Matthias Klose Date: Thu, 29 Apr 2004 04:54:39 +0000 (+0000) Subject: backport: re PR rtl-optimization/14235 (ICE in verify_local_live_at start (flow.c... X-Git-Tag: releases/gcc-3.3.4~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5fea360cc0327981bace19e67c14211f5c770b4;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/14235 (ICE in verify_local_live_at start (flow.c:546)) 2004-04-29 Matthias Klose Backport: 2004-03-04 Eric Botcazou PR optimization/14235 * expr.c (expand_expr_real) : Return a new pseudo when converting from a sub-word source to a larger-than-word register which conflicts with the source. 2004-04-29 Matthias Klose Backport: 2004-03-04 Eric Botcazou * gcc.c-torture/compile/20040304-1.c: New test. From-SVN: r81274 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fec6686fab6e..a11ba3c85b09 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-04-29 Matthias Klose + + Backport: + + 2004-03-04 Eric Botcazou + + PR optimization/14235 + * expr.c (expand_expr_real) : Return a new + pseudo when converting from a sub-word source to a + larger-than-word register which conflicts with the source. + 2004-04-29 Jakub Jelinek * config/sparc/sparc.h (FLOATDITF2_LIBCALL, FIX_TRUNCTFDI2_LIBCALL, diff --git a/gcc/expr.c b/gcc/expr.c index c7b14da283c9..1a162a95a609 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7909,9 +7909,18 @@ expand_expr (exp, target, tmode, modifier) return convert_to_mode (mode, op0, TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); - else - convert_move (target, op0, - TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); + + /* Check if convert_move may do the conversion by using a low-part, + after clobbering the whole target which is known to conflict with + the source. In this case, play safe and make a new pseudo. */ + if (GET_CODE (target) == REG + && GET_MODE_BITSIZE (GET_MODE (op0)) < BITS_PER_WORD + && GET_MODE_BITSIZE (mode) > BITS_PER_WORD + && ! safe_from_p (target, TREE_OPERAND (exp, 0), 1)) + target = gen_reg_rtx (mode); + + convert_move (target, op0, + TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); return target; case VIEW_CONVERT_EXPR: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4120627d6103..a3812b3314d5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2004-04-29 Matthias Klose + + Backport: + + 2004-03-04 Eric Botcazou + + * gcc.c-torture/compile/20040304-1.c: New test. + 2004-04-20 Paul Brook PR 2123