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

i386: Fix up *jcc_bt*_mask{,_1} [PR111408]

The following testcase is miscompiled in GCC 14 because the
*jcc_bt<mode>_mask and *jcc_bt<SWI48:mode>_mask_1 patterns have just
one argument in (match_operator 0 "bt_comparison_operator" [...])
but as bt_comparison_operator is eq,ne, we need two.
The md readers don't warn about it, after all, some checks can
be done in the predicate rather than specified explicitly, and the
behavior is that anything is accepted as the second argument.

I went through all other i386.md match_operator uses and all others
looked right (extract_operator using 3 operands, all others 2).

I think we'll want to fix this at different spots in older releases
because I think the bug was introduced already in 2008, though most
likely just latent.

2023-11-25  Jakub Jelinek  <jakub@redhat.com>

	PR target/111408
	* config/i386/i386.md (*jcc_bt<mode>_mask,
	*jcc_bt<SWI48:mode>_mask_1): Add (const_int 0) as expected
	second operand of bt_comparison_operator.

	* gcc.c-torture/execute/pr111408.c: New test.
parent a6a43a3b
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