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
This commit is contained in:
Jakub Jelinek 2013-03-06 18:18:46 +01:00
parent 28937f1196
commit a72d87803e
4 changed files with 48 additions and 20 deletions

View File

@ -1,3 +1,9 @@
2013-03-06 Jakub Jelinek <jakub@redhat.com>
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 <rguenther@suse.de>
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 <david.holsgrove@xilinx.com>
2013-03-05 David Holsgrove <david.holsgrove@xilinx.com>
* 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 <david.holsgrove@xilinx.com>
2013-03-04 David Holsgrove <david.holsgrove@xilinx.com>
* 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 <edgar.iglesias@gmail.com>
2013-03-04 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* 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 <jakub@redhat.com>
@ -598,10 +604,10 @@
2013-02-24 Catherine Moore <clm@codesourcery.com>
Maciej W. Rozycki <macro@codesourcery.com>
Tom de Vries <tom@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Iain Sandoe <iain@codesourcery.com>
Nathan Froyd <froydnj@codesourcery.com>
Chao-ying Fu <fu@mips.com>
Chao-ying Fu <fu@mips.com>
* 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 <clm@codesourcery.com>
Maciej W. Rozycki <macro@codesourcery.com>
Tom de Vries <tom@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Iain Sandoe <iain@codesourcery.com>
Nathan Froyd <froydnj@codesourcery.com>
Chao-ying Fu <fu@mips.com>
Chao-ying Fu <fu@mips.com>
* 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 <edgar.iglesias@gmail.com>
2012-02-19 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* 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 <edgar.iglesias@gmail.com>
2012-02-19 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* 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 <abel@ispras.ru>
@ -1343,7 +1349,7 @@
* config/avr/avr-dimode.md (umulsidi3, mulsidi3): New expanders.
(umulsidi3_insn, mulsidi3_insn): New insns.
2013-02-12 Christophe Lyon <christophe.lyon@linaro.org>
2013-02-12 Christophe Lyon <christophe.lyon@linaro.org>
* 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 <glider@google.com>
2013-02-11 Alexander Potapenko <glider@google.com>
Jack Howarth <howarth@bromo.med.uc.edu>
Jakub Jelinek <jakub@redhat.com>

View File

@ -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

View File

@ -1,3 +1,8 @@
2013-03-06 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56548
* gcc.dg/pr56548.c: New test.
2013-03-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR debug/53363
@ -147,7 +152,7 @@
Revert:
2013-02-24 Catherine Moore <clm@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
Richard Sandiford <rdsandiford@googlemail.com>
* 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 <clm@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
Richard Sandiford <rdsandiford@googlemail.com>
* 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 <glider@google.com>
2013-02-11 Alexander Potapenko <glider@google.com>
Jack Howarth <howarth@bromo.med.uc.edu>
Jakub Jelinek <jakub@redhat.com>
@ -720,7 +725,7 @@
PR fortran/47517
* gfortran.dg/realloc_on _assign_17.f90 : New test.
2013-02-04 Alexander Potapenko <glider@google.com>
2013-02-04 Alexander Potapenko <glider@google.com>
Jack Howarth <howarth@bromo.med.uc.edu>
Jakub Jelinek <jakub@redhat.com>
@ -843,7 +848,7 @@
* gfortran.dg/allocatable_function_6.f90: New.
2013-01-29 Janus Weil <janus@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
PR fortran/54107
* gfortran.dg/proc_ptr_comp_36.f90: New.

View File

@ -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;
}