On Tue Nov 10, 2026 at 11:52 AM PST, Roger Sayle wrote:
>
> This is a ping/resubmission of a clean-up patch from June 2024:
> https://gcc.gnu.org/pipermail/gcc-patches/2024-June/656052.html
>
> The history is a little complicated.  As observed by Hongtao in
> https://gcc.gnu.org/pipermail/gcc-patches/2024-July/656061.html
> back in 2024, this innocent clean-up patch exposed a latent bug
> in genrecog.  Indeed when the modified sse.md file is processed
> by an older genrecog it also generates incorrect C code, accessing
> an operand without confirming first confirming that the current
> rtx code has that many operands.
>
> I tried a few times in 2024 and 2025 to track down and fix this
> latent problem, probably a miscompilation, but things were complicated
> by the fact that it required a sizeable machine description to expose
> the mis-optimization of complex "recog" decision trees.
>
> When I came back to this issue in 2026, the problem had (somehow)
> been fixed and current genrecog now emits correct/reasonable code.
> I've been waiting for PR middle-end/126952 to be fixed (thanks to
> Jeff for the review/approval), so that --enable-checking=rtl can
> be used to confirm there's no longer a problem, and to prevent the
> underlying mysterious bug from reappearing in the future.
>
> Hopefully this all makes sense.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, both with and without --target_board=unix{-m32},
> and with/without --enable-checking=rtl with no new failures.
> Ok for mainline?
Please also remove regmem_or_bitnot_regmem_operand in predicates.md and
STRIP_UNARY in i386.h. They're only used by the removed patterns in the patch.

Others LGTM.
>
>
> 2026-11-10  Roger Sayle  <[email protected]>
>
> gcc/ChangeLog
>         * config/i386/sse.md (*vmov<mode>_constm1_pternlog_false_dep):
>         Use decimal instead hexadecimal.
>         (*<avx512>_cvtmask2<ssemodesuffix><mode>): Likewise.
>         (*<avx512>_cvtmask2<ssemodesuffix><mode>_pternlog_false_dep):
>         Likewise.
>         (any_logic1): Delete define_code_iterator.
>         (any_logic2): Likewise.
>         (logic_op): Delete define_code_attr.
>         (*<avx512>_vpternlog<mode>_1): Delete define_insn_and_split.
>         (*<avx512>_vpternlog<mode>_2): Likewise.
>         (*<avx512>_vpternlog<mode>_3): Likewise.
>         (<mask_codefor>one_cmpl<mode>2<mask_name>): Use decimal.
>         (*one_cmpl<mode>2_pternlog_false_dep): Likewise.
>         (*andnot<mode>3): Likewise.
>         (*iornot<mode>3): Delete define_insn.
>         (*xnor<mode>3): Likewise.
>         (andor): Delete define_code_iterator.
>         (nlogic): Delete define_code_attr.
>         (ternlog_nlogic): Likewise.
>         (*<nlogic><mode>3): Delete define_insn.
>
> gcc/testsuite/ChangeLog
>         * gcc.target/i386/builtin-memset-7c.c: Update test to decimal.
>         * gcc.target/i386/pr100711-6.c: Likewise.
>
>
> Roger
> --

Reply via email to