xtensa: fix PR target/94584
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 13 Apr 2020 20:26:04 +0000 (13:26 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 14 Apr 2020 23:55:40 +0000 (16:55 -0700)
commita288e202c5e50704968685fc2922d159335be2cb
tree052fab83de36d97b4b78981d3280f6bbff50fce9
parentae046fa25e5d4a905cc7fab028d0f92cb21dc972
xtensa: fix PR target/94584

Patterns zero_extendhisi2, zero_extendqisi2 and extendhisi2_internal can
load value from memory, but they don't treat volatile memory correctly.
Add %v1 before load instructions to emit 'memw' instruction when
-mserialize-volatile is in effect.

2020-04-14  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
* config/xtensa/xtensa.md (zero_extendhisi2, zero_extendqisi2)
(extendhisi2_internal): Add %v1 before the load instructions.

gcc/testsuite/
* gcc.target/xtensa/pr94584.c: New test.
gcc/ChangeLog
gcc/config/xtensa/xtensa.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/xtensa/pr94584.c [new file with mode: 0644]