aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2023-12-04 10:06:49 -0700
committerJeff Law <jlaw@ventanamicro.com>2023-12-04 10:06:49 -0700
commitb544ec681bdc9c48587d2e014f9559674097738a (patch)
tree6e7b720b22d9af3ceaf70f526401366fb0bcb6a0
parentd9b51588e960239337c964e5ddd87ac5c4c2f086 (diff)
downloadgcc-b544ec681bdc9c48587d2e014f9559674097738a.zip
gcc-b544ec681bdc9c48587d2e014f9559674097738a.tar.gz
gcc-b544ec681bdc9c48587d2e014f9559674097738a.tar.bz2
[committed] Fix HImode load mnemonic on microblaze port
The tester recently started failing va-arg-22.c on microblaze-linux: gcc.c-torture/execute/va-arg-22.c -O0 (test for excess errors) It was failing with an undefined reference to "r7" at link time. This was ultimately tracked down to a HImode load using (reg+reg) addressing mode, but which used the lhui instruction instead of lhu. The "i" means it's supposed to be (reg+disp) so the assembler tried to interpret "r7" as an immediate/symbol. The port uses %i<opnum> as an output modifier to select between sh/shi and various other mnemonics for loads/stores. The movhi pattern simply failed to use it for the two cases where it's loading from memory (interestingly enough it was used for stores). Clearly we aren't using reg+reg much for HImode loads as this didn't fix anything else in the testsuite. gcc/ * config/microblaze/microblaze.md (movhi): Use %i for half-word loads to properly select between lhu/lhui.
-rw-r--r--gcc/config/microblaze/microblaze.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 671667b..a8ee886 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -1089,8 +1089,8 @@
"@
addik\t%0,r0,%1\t# %X1
addk\t%0,%1,r0
- lhui\t%0,%1
- lhui\t%0,%1
+ lhu%i1\t%0,%1
+ lhu%i1\t%0,%1
sh%i0\t%z1,%0
sh%i0\t%z1,%0"
[(set_attr "type" "arith,move,load,no_delay_load,store,no_delay_store")