Skip to content
Snippets Groups Projects
Commit 3a32fb2e authored by David Malcolm's avatar David Malcolm
Browse files

analyzer: fix folding of '(PTR + 0) => PTR' [PR105784]


gcc/analyzer/ChangeLog:
	PR analyzer/105784
	* region-model-manager.cc
	(region_model_manager::maybe_fold_binop): For POINTER_PLUS_EXPR,
	PLUS_EXPR and MINUS_EXPR, eliminate requirement that the final
	type matches that of arg0 in favor of a cast.

gcc/testsuite/ChangeLog:
	PR analyzer/105784
	* gcc.dg/analyzer/torture/fold-ptr-arith-pr105784.c: New test.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 000e9863
No related branches found
No related tags found
No related merge requests found
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