diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 660098429a2..5533c6e92d3 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -30267,7 +30267,7 @@ (match_operand:SWI48 1 "memory_operand" "m")] UNSPECV_WRSS)] "TARGET_SHSTK" - "wrss\t%0, %1" + "wrss\t{%0, %1|%1, %0}" [(set_attr "length" "3") (set_attr "type" "other")]) @@ -30276,7 +30276,7 @@ (match_operand:SWI48 1 "memory_operand" "m")] UNSPECV_WRUSS)] "TARGET_SHSTK" - "wruss\t%0, %1" + "wruss\t{%0, %1|%1, %0}" [(set_attr "length" "4") (set_attr "type" "other")]) diff --git a/gcc/testsuite/gcc.target/i386/cet-pr124366.c b/gcc/testsuite/gcc.target/i386/cet-pr124366.c new file mode 100644 index 00000000000..30a528299c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/cet-pr124366.c @@ -0,0 +1,31 @@ +/* PR target/124366 */ +/* { dg-do assemble { target { cet && masm_intel } } } */ +/* { dg-options "-O2 -mshstk -masm=intel" } */ + +#include + +void +wrssd (unsigned int x, void *y) +{ + _wrssd (x, y); +} + +void +wrussd (unsigned int x, void *y) +{ + _wrussd (x, y); +} + +#ifdef __x86_64__ +void +wrssq (unsigned long long x, void *y) +{ + _wrssq (x, y); +} + +void +wrussq (unsigned long long x, void *y) +{ + _wrussq (x, y); +} +#endif