[all-commits] [llvm/llvm-project] 860b6e: MIPS: fix emitDirectiveCpsetup on N32 (#80534)

YunQiang Su via All-commits all-commits at lists.llvm.org
Mon Feb 26 13:09:11 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 860b6edfa9b344fbf8c500c17158c8212ea87d1c
      https://github.com/llvm/llvm-project/commit/860b6edfa9b344fbf8c500c17158c8212ea87d1c
  Author: YunQiang Su <syq at debian.org>
  Date:   2024-02-26 (Mon, 26 Feb 2024)

  Changed paths:
    M llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
    M llvm/test/MC/Mips/cpsetup.s

  Log Message:
  -----------
  MIPS: fix emitDirectiveCpsetup on N32 (#80534)

In gas, .cpsetup may expand to one of two code sequences (one is related to `__gnu_local_gp`), depending on -mno-shared and -msym32.
Since Clang doesn't support -mno-shared or -msym32, .cpsetup expands to one code sequence.
The N32 condition incorrectly leads to the incorrect `__gnu_local_gp` code sequence.

```
00000000 <t1>:
   0:   ffbc0008        sd      gp,8(sp)
   4:   3c1c0000        lui     gp,0x0
                        4: R_MIPS_HI16  __gnu_local_gp
   8:   279c0000        addiu   gp,gp,0
                        8: R_MIPS_LO16  __gnu_local_gp
```

Fixes: #52785



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list