From 755cd5a907454199a9bff3d6f9f4baa4b298289d Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Mon, 14 Dec 2015 17:13:33 +0100 Subject: [PATCH] rs6000: Fix a mistake in cstore_si_as_di (PR68865, PR68879) convert_move does not know how to zero-extend a constant integer to the target mode -- simply because it does not know the source mode. As a result, 32-bit SImode with the high bit set would be effectively sign- extended instead of zero-extended. This patch fixes it. PR target/68865 PR target/68879 * config/rs6000/rs6000.md (cstore_si_as_di): Force all operands into registers. From-SVN: r231621 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/rs6000.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed6f28e..14efd7a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-12-14 Segher Boessenkool + + PR target/68865 + PR target/68879 + * config/rs6000/rs6000.md (cstore_si_as_di): Force all operands + into registers. + 2015-12-14 Richard Biener Revert accidentially applied diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 66a62ef..35685a9 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -10631,6 +10631,8 @@ int uns_flag = unsigned_comparison_operator (operands[1], VOIDmode) ? 1 : 0; enum rtx_code cond_code = signed_condition (GET_CODE (operands[1])); + operands[2] = force_reg (SImode, operands[2]); + operands[3] = force_reg (SImode, operands[3]); rtx op1 = gen_reg_rtx (DImode); rtx op2 = gen_reg_rtx (DImode); convert_move (op1, operands[2], uns_flag); -- 2.7.4