Commit 01726bc9 by Kyrylo Tkachov Committed by Kyrylo Tkachov

[riscv] Fix build due to INT16_MAX issue

	* config/riscv/riscv.c (riscv_build_integer_1): Avoid use of INT16_MAX.

From-SVN: r245272
parent d798497e
2016-02-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/riscv/riscv.c (riscv_build_integer_1): Avoid use of INT16_MAX.
2017-02-08 Richard Biener <rguenther@suse.de> 2017-02-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/71824 PR tree-optimization/71824
......
...@@ -356,7 +356,9 @@ riscv_build_integer_1 (struct riscv_integer_op codes[RISCV_MAX_INTEGER_OPS], ...@@ -356,7 +356,9 @@ riscv_build_integer_1 (struct riscv_integer_op codes[RISCV_MAX_INTEGER_OPS],
/* End with ADDI. When constructing HImode constants, do not generate any /* End with ADDI. When constructing HImode constants, do not generate any
intermediate value that is not itself a valid HImode constant. The intermediate value that is not itself a valid HImode constant. The
XORI case below will handle those remaining HImode constants. */ XORI case below will handle those remaining HImode constants. */
if (low_part != 0 && (mode != HImode || value - low_part <= INT16_MAX)) if (low_part != 0
&& (mode != HImode
|| value - low_part <= ((1 << (GET_MODE_BITSIZE (HImode) - 1)) - 1)))
{ {
alt_cost = 1 + riscv_build_integer_1 (alt_codes, value - low_part, mode); alt_cost = 1 + riscv_build_integer_1 (alt_codes, value - low_part, mode);
if (alt_cost < cost) if (alt_cost < cost)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment