From 5704db3364d16d19ef2da79b2a6c21da8160b939 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 24 Dec 2014 13:36:29 +0000 Subject: [PATCH] re PR target/64160 (msp430 code generation error adding 32-bit integers) PR target/64160 * config/msp430/msp430.md (addsi splitter): Do not split when the destination partially overlaps the source. From-SVN: r219058 --- gcc/ChangeLog | 6 ++++++ gcc/config/msp430/msp430.md | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d817d26994..259e2af9f98 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-24 Nick Clifton + + PR target/64160 + * config/msp430/msp430.md (addsi splitter): Do not split when the + destination partially overlaps the source. + 2014-12-22 Zhouyi Zhou * ira-build.c (ira_flattening): Add the current diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md index 60e7b6ff142..d9abeef545b 100644 --- a/gcc/config/msp430/msp430.md +++ b/gcc/config/msp430/msp430.md @@ -402,14 +402,16 @@ operands[6] = msp430_subreg (HImode, operands[0], SImode, 2); operands[7] = msp430_subreg (HImode, operands[1], SImode, 2); operands[8] = msp430_subreg (HImode, operands[2], SImode, 2); + + /* BZ 64160: Do not use this splitter when the dest partially overlaps the source. */ + if (reg_overlap_mentioned_p (operands[3], operands[7]) + || reg_overlap_mentioned_p (operands[3], operands[8])) + FAIL; + if (GET_CODE (operands[5]) == CONST_INT) - { - operands[9] = GEN_INT (INTVAL (operands[5]) & 0xffff); - } + operands[9] = GEN_INT (INTVAL (operands[5]) & 0xffff); else - { - operands[9] = gen_rtx_ZERO_EXTEND (SImode, operands[5]); - } + operands[9] = gen_rtx_ZERO_EXTEND (SImode, operands[5]); " ) -- 2.30.2