Skip to content
Snippets Groups Projects
Commit 22fe3c05 authored by Alexandre Oliva's avatar Alexandre Oliva Committed by Alexandre Oliva
Browse files

[ifcombine] check and extend constants to compare with bitfields

Add logic to check and extend constants compared with bitfields, so
that fields are only compared with constants they could actually
equal.  This involves making sure the signedness doesn't change
between loads and conversions before shifts: we'd need to carry a lot
more data to deal with all the possibilities.


for  gcc/ChangeLog

	PR tree-optimization/118456
	* gimple-fold.cc (decode_field_reference): Punt if shifting
	after changing signedness.
	(fold_truth_andor_for_ifcombine): Check extension bits in
	constants before clipping.

for  gcc/testsuite/ChangeLog

	PR tree-optimization/118456
	* gcc.dg/field-merge-21.c: New.
	* gcc.dg/field-merge-22.c: New.
parent e5e9e50f
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