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

tree-ssa-dce: Fix calloc handling [PR118224]

As reported by Dimitar, this should have been a multiplication, but wasn't
caught because in the test (~(__SIZE_TYPE__) 0) / 2 is the largest accepted
size and so adding 3 to it also resulted in "overflow".

The following patch adds one subtest to really verify it is a multiplication
and fixes the operation.

2025-01-20  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/118224
	* tree-ssa-dce.cc (is_removable_allocation_p): Multiply a1 by a2
	instead of adding it.

	* gcc.dg/pr118224.c: New test.
parent 459816ef
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