diff options
author | Jeff Law <law@redhat.com> | 2015-09-29 10:25:21 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2015-09-29 10:25:21 -0600 |
commit | 3ea7f8e52498b9db9a16fe61ea4c37619acb088b (patch) | |
tree | 62228c6518a05a0eaa8e3cfad34c29528a591265 /gcc/config/msp430/msp430.c | |
parent | 6d601106549923b90769b0bbf6bad9052a9667ac (diff) | |
download | gcc-3ea7f8e52498b9db9a16fe61ea4c37619acb088b.zip gcc-3ea7f8e52498b9db9a16fe61ea4c37619acb088b.tar.gz gcc-3ea7f8e52498b9db9a16fe61ea4c37619acb088b.tar.bz2 |
[PATCH] Fix undefined behaviour in msp430 port
* config/msp430/msp430.c (msp430_legitimate_constant): Fix undefined
left shift behaviour.
* config/msp430/constraints.md ('L' constraint): Similarly.
('Ys' constraint): Similarly.
From-SVN: r228251
Diffstat (limited to 'gcc/config/msp430/msp430.c')
-rw-r--r-- | gcc/config/msp430/msp430.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index d2308cb..ba8d862 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -998,7 +998,7 @@ msp430_legitimate_constant (machine_mode mode, rtx x) /* GCC does not know the width of the PSImode, so make sure that it does not try to use a constant value that is out of range. */ - || (INTVAL (x) < (1 << 20) && INTVAL (x) >= (-1 << 20)); + || (INTVAL (x) < (1 << 20) && INTVAL (x) >= (HOST_WIDE_INT)(HOST_WIDE_INT_M1U << 20)); } |