diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-02-13 14:20:06 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-02-13 14:20:06 +0100 |
commit | a4d70cfae354d7eb55b70d877b8fe3ed9b0ec955 (patch) | |
tree | c1735f9881991b7373fa30d6129d1344232c83c2 /gcc/expr.c | |
parent | e697d1191cdd301abe0c0b89a5ced36dc3f5f9a3 (diff) | |
download | gcc-a4d70cfae354d7eb55b70d877b8fe3ed9b0ec955.zip gcc-a4d70cfae354d7eb55b70d877b8fe3ed9b0ec955.tar.gz gcc-a4d70cfae354d7eb55b70d877b8fe3ed9b0ec955.tar.bz2 |
re PR target/43546 (ICE: in assign_stack_local_1, at function.c:353 with -mpreferred-stack-boundary=2 -msseregparm)
PR target/43546
* expr.c (compress_float_constant): If x is a hard register,
extend into a pseudo and then move to x.
* gcc.target/i386/pr43546.c: New test.
From-SVN: r207757
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -3726,12 +3726,21 @@ compress_float_constant (rtx x, rtx y) into a new pseudo. This constant may be used in different modes, and if not, combine will put things back together for us. */ trunc_y = force_reg (srcmode, trunc_y); - emit_unop_insn (ic, x, trunc_y, UNKNOWN); + + /* If x is a hard register, perform the extension into a pseudo, + so that e.g. stack realignment code is aware of it. */ + rtx target = x; + if (REG_P (x) && HARD_REGISTER_P (x)) + target = gen_reg_rtx (dstmode); + + emit_unop_insn (ic, target, trunc_y, UNKNOWN); last_insn = get_last_insn (); - if (REG_P (x)) + if (REG_P (target)) set_unique_reg_note (last_insn, REG_EQUAL, y); + if (target != x) + return emit_move_insn (x, target); return last_insn; } |