Commit 6966918
committed
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.1 parent 7c2e60f commit 6966918
File tree
5 files changed
+44
-25
lines changed- gcc
- config/i386
- testsuite/gcc.target/i386
5 files changed
+44
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8933 | 8933 | | |
8934 | 8934 | | |
8935 | 8935 | | |
8936 | | - | |
| 8936 | + | |
| 8937 | + | |
8937 | 8938 | | |
8938 | 8939 | | |
8939 | 8940 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5180 | 5180 | | |
5181 | 5181 | | |
5182 | 5182 | | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
5183 | 5204 | | |
5184 | 5205 | | |
5185 | 5206 | | |
| |||
14296 | 14317 | | |
14297 | 14318 | | |
14298 | 14319 | | |
14299 | | - | |
| 14320 | + | |
14300 | 14321 | | |
14301 | 14322 | | |
14302 | 14323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25599 | 25599 | | |
25600 | 25600 | | |
25601 | 25601 | | |
25602 | | - | |
| 25602 | + | |
| 25603 | + | |
| 25604 | + | |
25603 | 25605 | | |
25604 | 25606 | | |
25605 | 25607 | | |
| |||
25634 | 25636 | | |
25635 | 25637 | | |
25636 | 25638 | | |
25637 | | - | |
25638 | | - | |
| 25639 | + | |
25639 | 25640 | | |
25640 | 25641 | | |
25641 | 25642 | | |
25642 | 25643 | | |
25643 | 25644 | | |
25644 | 25645 | | |
25645 | | - | |
| 25646 | + | |
25646 | 25647 | | |
25647 | 25648 | | |
25648 | 25649 | | |
| |||
25658 | 25659 | | |
25659 | 25660 | | |
25660 | 25661 | | |
25661 | | - | |
25662 | | - | |
| 25662 | + | |
25663 | 25663 | | |
25664 | 25664 | | |
25665 | 25665 | | |
25666 | 25666 | | |
25667 | 25667 | | |
25668 | 25668 | | |
25669 | | - | |
| 25669 | + | |
25670 | 25670 | | |
25671 | 25671 | | |
25672 | 25672 | | |
| |||
25682 | 25682 | | |
25683 | 25683 | | |
25684 | 25684 | | |
25685 | | - | |
25686 | | - | |
| 25685 | + | |
25687 | 25686 | | |
25688 | 25687 | | |
25689 | 25688 | | |
25690 | 25689 | | |
25691 | 25690 | | |
25692 | 25691 | | |
25693 | | - | |
| 25692 | + | |
25694 | 25693 | | |
25695 | 25694 | | |
25696 | 25695 | | |
| |||
25706 | 25705 | | |
25707 | 25706 | | |
25708 | 25707 | | |
25709 | | - | |
25710 | | - | |
| 25708 | + | |
25711 | 25709 | | |
25712 | 25710 | | |
25713 | 25711 | | |
25714 | 25712 | | |
25715 | 25713 | | |
25716 | 25714 | | |
25717 | | - | |
| 25715 | + | |
25718 | 25716 | | |
25719 | 25717 | | |
25720 | 25718 | | |
| |||
25754 | 25752 | | |
25755 | 25753 | | |
25756 | 25754 | | |
25757 | | - | |
25758 | | - | |
| 25755 | + | |
25759 | 25756 | | |
25760 | 25757 | | |
25761 | 25758 | | |
25762 | 25759 | | |
25763 | 25760 | | |
25764 | 25761 | | |
25765 | | - | |
| 25762 | + | |
25766 | 25763 | | |
25767 | 25764 | | |
25768 | 25765 | | |
| |||
25782 | 25779 | | |
25783 | 25780 | | |
25784 | 25781 | | |
25785 | | - | |
25786 | | - | |
| 25782 | + | |
25787 | 25783 | | |
25788 | 25784 | | |
25789 | 25785 | | |
25790 | 25786 | | |
25791 | 25787 | | |
25792 | 25788 | | |
25793 | | - | |
| 25789 | + | |
25794 | 25790 | | |
25795 | 25791 | | |
25796 | 25792 | | |
| |||
25808 | 25804 | | |
25809 | 25805 | | |
25810 | 25806 | | |
25811 | | - | |
25812 | | - | |
| 25807 | + | |
25813 | 25808 | | |
25814 | 25809 | | |
25815 | 25810 | | |
25816 | 25811 | | |
25817 | 25812 | | |
25818 | 25813 | | |
25819 | | - | |
| 25814 | + | |
25820 | 25815 | | |
25821 | 25816 | | |
25822 | 25817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
0 commit comments