diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2025-04-29 18:08:05 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2025-04-29 18:15:03 +0200 |
commit | 69669180d29cc420b1b1ac86530a4f9573748d81 (patch) | |
tree | d39f89589fc3a0b4b5889d64c2ab04656fb6897c /gcc/rust/backend | |
parent | 7c2e60f67a02d17d8c2f67ba438fdb50d51bc9f4 (diff) | |
download | gcc-69669180d29cc420b1b1ac86530a4f9573748d81.zip gcc-69669180d29cc420b1b1ac86530a4f9573748d81.tar.gz gcc-69669180d29cc420b1b1ac86530a4f9573748d81.tar.bz2 |
i386: Disable string insn from non-default AS for Pmode != word_mode [PR111657]
0x67 prefix is applied before segment register. That is in
rep movsq %gs:(%esi), (%edi)
the address is %gs + %esi. In case Pmode != word_mode (x32 with a default
-maddress-mode=short) instructions should not allow segment override prefixes.
Also, remove explicit addr32 prefix from asm templates because address
mode can be determined from explicit instruction operands. Also note that
Pmode != word_mode only with TARGET_64BIT, so the check in ix86_print_operand
is not needed.
PR target/111657
gcc/ChangeLog:
* config/i386/i386-expand.cc (alg_usable_p): For Pmode != word_mode
reject rep_prefix_{1,4,8}_byte algorithms with src_as in the
non-default address space.
* config/i386/i386-protos.h (ix86_check_movs): New prototype.
* config/i386/i386.cc (ix86_check_movs): New function.
(ix86_print_operand) [case '^']: Remove excess check for TARGET_64BIT.
* config/i386/i386.md (strmov): For Pmode != word_mode expand with
gen_strmov_single only when operands[3] (source) is in the default
address space.
(*strmovdi_rex_1) Use ix86_check_movs. Remove %^ from asm template.
(*strmovsi_1): Ditto.
(*strmovhi_1): DItto.
(*strmovqi_1): Ditto.
(*rep_movdi_rex64): Ditto.
(*rep_movsi): Ditto.
(*rep_movqi): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr111657-1.c: Check that segment override is not
generated for "rep movsq" for x32 target.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions