projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17bffa0
)
mips: avoid signed overflow in LUI_OPERAND [PR104842]
author
Xi Ruoyao
<xry111@mengyan1223.wang>
Tue, 8 Mar 2022 17:08:58 +0000
(
01:08
+0800)
committer
Xi Ruoyao
<xry111@mengyan1223.wang>
Wed, 9 Mar 2022 03:21:08 +0000
(11:21 +0800)
gcc/
PR target/104842
* config/mips/mips.h (LUI_OPERAND): Cast the input to an unsigned
value before adding an offset.
gcc/config/mips/mips.h
patch
|
blob
|
history
diff --git
a/gcc/config/mips/mips.h
b/gcc/config/mips/mips.h
index bf5c1d5a7092e36798d31e133ebc8a66906905ee..0029864fdcdf0b68a5467dcad9bdb991aae40fe1 100644
(file)
--- a/
gcc/config/mips/mips.h
+++ b/
gcc/config/mips/mips.h
@@
-2309,7
+2309,7
@@
enum reg_class
#define LUI_OPERAND(VALUE) \
(((VALUE) | 0x7fff0000) == 0x7fff0000 \
- || ((VALUE) | 0x7fff0000) + 0x10000 == 0)
+ || ((
unsigned HOST_WIDE_INT) (
VALUE) | 0x7fff0000) + 0x10000 == 0)
/* Return a value X with the low 16 bits clear, and such that
VALUE - X is a signed 16-bit value. */