Skip to content
Snippets Groups Projects
Commit be63b77d authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

re PR middle-end/56420 (Arithmetic error in computation with compile time...

re PR middle-end/56420 (Arithmetic error in computation with compile time unsigned __int128 constant)

	PR middle-end/56420
	* expmed.c (EXACT_POWER_OF_2_OR_ZERO_P): Do subtraction in uhwi, to
	avoid signed wrapping.
	(expand_mult): Handle properly multiplication by
	((dword_type) -1) << (BITS_PER_WORD - 1).  Improve multiplication by
	((dword_type) 1) << (BITS_PER_WORD - 1).  Avoid undefined behavior
	in the compiler if coeff is HOST_WIDE_INT_MIN.
	(expand_divmod): Don't make ext_op1 static, change it's type to
	uhwi.  Avoid undefined behavior in -INTVAL (op1).

	* gcc.dg/torture/pr56420.c: New test.

From-SVN: r196215
parent d7fde18c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment