Skip to content
Snippets Groups Projects
Commit 32ee4728 authored by Jeff Law's avatar Jeff Law
Browse files

Improve overflow check

Convert
x < (short) ((unsigned short)x + const)
to
x <= SHORT_MAX – const
(and similarly for other integral types) if const is not 0.

gcc/
	PR tree-optimization/97223
	* match.pd (overflow detection and optimization): Handle conversions.

gcc/testsuite/

	* gcc.dg/no-strict-overflow-4.c: Adjust expected output.
parent 6483f059
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