aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2013-03-06 18:18:46 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-03-06 18:18:46 +0100
commita72d87803e238ec0302aede5ac0267a02c42085e (patch)
treeed41f33979c0edc53fadd53f349690eabb055f20 /gcc/expr.c
parent28937f1196166ef33c303ff09f0d7f4936faec81 (diff)
downloadgcc-a72d87803e238ec0302aede5ac0267a02c42085e.zip
gcc-a72d87803e238ec0302aede5ac0267a02c42085e.tar.gz
gcc-a72d87803e238ec0302aede5ac0267a02c42085e.tar.bz2
re PR middle-end/56548 (ICE in emit_move_insn, at expr.c:3486 with -march=pentium{pro,2,3} -O3)
PR middle-end/56548 * expr.c (expand_cond_expr_using_cmove): When expanding cmove in promoted mode, convert the result back to the original mode. * gcc.dg/pr56548.c: New test. From-SVN: r196498
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index d225479..e3fb0b6 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7884,6 +7884,7 @@ expand_cond_expr_using_cmove (tree treeop0 ATTRIBUTE_UNUSED,
tree type = TREE_TYPE (treeop1);
int unsignedp = TYPE_UNSIGNED (type);
enum machine_mode mode = TYPE_MODE (type);
+ enum machine_mode orig_mode = mode;
/* If we cannot do a conditional move on the mode, try doing it
with the promoted mode. */
@@ -7949,7 +7950,7 @@ expand_cond_expr_using_cmove (tree treeop0 ATTRIBUTE_UNUSED,
rtx seq = get_insns ();
end_sequence ();
emit_insn (seq);
- return temp;
+ return convert_modes (orig_mode, mode, temp, 0);
}
/* Otherwise discard the sequence and fall back to code with