[Bug target/112970] LoongArch: Suboptimal code when the address and the value of an array element are both used

2023-12-11 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112970 --- Comment #2 from Xi Ruoyao --- (In reply to Xi Ruoyao from comment #1) > With -mexplicit-relocs=auto the generated code is sub-optimal as well: I mean "always", not "auto". > pcalau12i $r12,%pc_hi20(.LANCHOR0) > addi.d

[Bug target/112970] LoongArch: Suboptimal code when the address and the value of an array element are both used

2023-12-11 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112970 --- Comment #1 from Xi Ruoyao --- With -mexplicit-relocs=auto the generated code is sub-optimal as well: pcalau12i $r12,%pc_hi20(.LANCHOR0) addi.d $r12,$r12,%pc_lo12(.LANCHOR0) ld.wu $r5,$r12,4 addi.d