diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3eaab4c40a5..1f428c5bc18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-03-06 Jakub Jelinek + + 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. + 2013-03-06 Richard Biener PR middle-end/56294 @@ -84,7 +90,7 @@ * sdbout.c (sdbout_one_type): Switch to current function's section supporting cold/hot. -2013-03-05 David Holsgrove +2013-03-05 David Holsgrove * doc/invoke.texi (MicroBlaze): Add -mbig-endian, -mlittle-endian, -mxl-reorder. @@ -213,7 +219,7 @@ * ipa-split.c (split_function): Do not set the RSO flag if result is not by reference and its type is a register type. -2013-03-04 David Holsgrove +2013-03-04 David Holsgrove * config/microblaze/microblaze.c (microblaze_valid_pic_const): New (microblaze_legitimate_pic_operand): Likewise @@ -222,11 +228,11 @@ * config/microblaze/microblaze-protos.h (microblaze_legitimate_pic_operand): Declare. -2013-03-04 Edgar E. Iglesias +2013-03-04 Edgar E. Iglesias - * config/microblaze/predicates.md (call_insn_simple_operand): + * config/microblaze/predicates.md (call_insn_simple_operand): New predicate for supported rtx code types. - * config/microblaze/microblaze.md (call_internal1): Use + * config/microblaze/microblaze.md (call_internal1): Use call_insn_simple_operand predicate. 2013-03-04 Jakub Jelinek @@ -598,10 +604,10 @@ 2013-02-24 Catherine Moore Maciej W. Rozycki Tom de Vries - Nathan Sidwell + Nathan Sidwell Iain Sandoe Nathan Froyd - Chao-ying Fu + Chao-ying Fu * doc/extend.texi: (micromips, nomicromips, nocompression): Document new function attributes. * doc/invoke.texi (minterlink-compressed, mmicromips, @@ -747,10 +753,10 @@ 2013-02-24 Catherine Moore Maciej W. Rozycki Tom de Vries - Nathan Sidwell + Nathan Sidwell Iain Sandoe Nathan Froyd - Chao-ying Fu + Chao-ying Fu * doc/extend.texi: (micromips, nomicromips, nocompression): Document new function attributes. @@ -1053,7 +1059,7 @@ * config/i386/i386.c (initial_ix86_tune_features): Turn on fp reassociation for avx2 targets. -2012-02-19 Edgar E. Iglesias +2012-02-19 Edgar E. Iglesias * config/microblaze/microblaze.c: microblaze_has_clz = 0 Add version check for v8.10.a to enable microblaze_has_clz @@ -1061,9 +1067,9 @@ version and TARGET_PATTERN_COMPARE check * config/microblaze/microblaze.md: New clzsi2 instruction -2012-02-19 Edgar E. Iglesias +2012-02-19 Edgar E. Iglesias - * config/microblaze/microblaze.md (call_value_intern): Check symbol is + * config/microblaze/microblaze.md (call_value_intern): Check symbol is function before branching. 2012-02-19 Andrey Belevantsev @@ -1343,7 +1349,7 @@ * config/avr/avr-dimode.md (umulsidi3, mulsidi3): New expanders. (umulsidi3_insn, mulsidi3_insn): New insns. -2013-02-12 Christophe Lyon +2013-02-12 Christophe Lyon * config/arm/arm-protos.h (struct cpu_vec_costs): New struct type. (struct tune_params): Add vec_costs field. @@ -1397,7 +1403,7 @@ define ENDFILE_SPEC as TM_DESTRUCTOR. * config/i386/darwin.h (ENDFILE_SPEC): Use TM_DESTRUCTOR. -2013-02-11 Alexander Potapenko +2013-02-11 Alexander Potapenko Jack Howarth Jakub Jelinek diff --git a/gcc/expr.c b/gcc/expr.c index d225479e84e..e3fb0b63bff 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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c8853c4d1f4..df583d6a03b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-03-06 Jakub Jelinek + + PR middle-end/56548 + * gcc.dg/pr56548.c: New test. + 2013-03-06 Rainer Orth PR debug/53363 @@ -147,7 +152,7 @@ Revert: 2013-02-24 Catherine Moore - Richard Sandiford + Richard Sandiford * gcc.target/mips/mips.exp: Add microMIPS support. * gcc.target/mips/umips-movep-2.c: New test. @@ -175,7 +180,7 @@ * gcc.target/mips/umips-swp-4.c: New test. 2013-02-24 Catherine Moore - Richard Sandiford + Richard Sandiford * gcc.target/mips/mips.exp: Add microMIPS support. * gcc.target/mips/umips-movep-2.c: New test. @@ -495,7 +500,7 @@ * gcc.target/powerpc/ppc-stackalign-1.c: Likewise. * gcc.target/powerpc/ppc-ldstruct.c: Likewise. -2013-02-11 Alexander Potapenko +2013-02-11 Alexander Potapenko Jack Howarth Jakub Jelinek @@ -720,7 +725,7 @@ PR fortran/47517 * gfortran.dg/realloc_on _assign_17.f90 : New test. -2013-02-04 Alexander Potapenko +2013-02-04 Alexander Potapenko Jack Howarth Jakub Jelinek @@ -843,7 +848,7 @@ * gfortran.dg/allocatable_function_6.f90: New. 2013-01-29 Janus Weil - Mikael Morin + Mikael Morin PR fortran/54107 * gfortran.dg/proc_ptr_comp_36.f90: New. diff --git a/gcc/testsuite/gcc.dg/pr56548.c b/gcc/testsuite/gcc.dg/pr56548.c new file mode 100644 index 00000000000..2aa61d9cc60 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr56548.c @@ -0,0 +1,16 @@ +/* PR middle-end/56548 */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-additional-options "-march=pentium3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ + +short +foo (short x) +{ + int i; + + for (i = 0; i < 3; i++) + if (x > 0) + x--; + + return x; +}