diff options
author | Jeff Law <law@redhat.com> | 2014-02-11 06:58:46 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2014-02-11 06:58:46 -0700 |
commit | cddddfff5b66e27088a746554aaa6f6315022ce8 (patch) | |
tree | 38c201a84cc798976a515d8d0938e4c6456ab86d /gcc/expr.c | |
parent | 7c1aef7e398228f37d8dae0aa3b36d75a8316d15 (diff) | |
download | gcc-cddddfff5b66e27088a746554aaa6f6315022ce8.zip gcc-cddddfff5b66e27088a746554aaa6f6315022ce8.tar.gz gcc-cddddfff5b66e27088a746554aaa6f6315022ce8.tar.bz2 |
re PR middle-end/54041 (-mshort ICE in convert_memory_address_addr_space, at explow.c:327)
PR middle-end/54041
* expr.c (expand_expr_addr_expr_1): Handle expand_expr returning an
object with an undesirable mode.
PR middle-end/54041
* gcc.target/m68k/pr54041.c: New test.
From-SVN: r207689
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -7708,6 +7708,11 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, modifier == EXPAND_INITIALIZER ? EXPAND_INITIALIZER : EXPAND_NORMAL); + /* expand_expr is allowed to return an object in a mode other + than TMODE. If it did, we need to convert. */ + if (GET_MODE (tmp) != VOIDmode && tmode != GET_MODE (tmp)) + tmp = convert_modes (tmode, GET_MODE (tmp), + tmp, TYPE_UNSIGNED (TREE_TYPE (offset))); result = convert_memory_address_addr_space (tmode, result, as); tmp = convert_memory_address_addr_space (tmode, tmp, as); |