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

i386: Fix ICE on __builtin_ia32_pabsd128 without lhs [PR112962]

The following patch fixes ICE on the testcase in similar way to how
other folded builtins are handled in ix86_gimple_fold_builtin when
they don't have a lhs; these builtins are const or pure, so normally
DCE would remove them later, but with -O0 that isn't guaranteed to
happen, and during expansion if they are marked TREE_SIDE_EFFECTS
it might still be attempted to be expanded.
This removes them right away during the folding.

Initially I wanted to also change all gsi_replace last args in that function
to true, but Andrew pointed to PR107209, so I've kept them as is.

2023-12-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/112962
	* config/i386/i386.cc (ix86_gimple_fold_builtin): For shifts
	and abs without lhs replace with nop.

	* gcc.target/i386/pr112962.c: New test.
parent 4dfc6bca
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