[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #21 from GCC Commits --- The releases/gcc-11 branch has been updated by YunQiang Su : https://gcc.gnu.org/g:1bc4a777b21ae36b116e1842b7c482340ec929ef commit r11-11457-g1bc4a777b21ae36b116e1842b7c482340ec929ef Author: YunQiang Su

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #20 from GCC Commits --- The releases/gcc-13 branch has been updated by YunQiang Su : https://gcc.gnu.org/g:3be8fa7b19d218ca5812d71801e3e83ee2260ea0 commit r13-8809-g3be8fa7b19d218ca5812d71801e3e83ee2260ea0 Author: YunQiang Su

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #19 from GCC Commits --- The releases/gcc-12 branch has been updated by YunQiang Su : https://gcc.gnu.org/g:e26f16424f6279662efb210bc87c77148e956fed commit r12-10480-ge26f16424f6279662efb210bc87c77148e956fed Author: YunQiang Su

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #18 from GCC Commits --- The releases/gcc-14 branch has been updated by YunQiang Su : https://gcc.gnu.org/g:201cfa725587d13867b4dc25955434ebe90aff7b commit r14-10260-g201cfa725587d13867b4dc25955434ebe90aff7b Author: YunQiang Su

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread mschiffer--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #17 from Matthias Schiffer --- I have now verified replacing Felix's patch with your new patch in the OpenWrt toolchain (currently based on GCC 13.3) results in correct compilation, while a GCC 13.3 without these patches applied

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 YunQiang Su changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #15 from GCC Commits --- The master branch has been updated by YunQiang Su : https://gcc.gnu.org/g:915440eed21de367cb41857afb5273aff5bcb737 commit r15-911-g915440eed21de367cb41857afb5273aff5bcb737 Author: YunQiang Su Date: Wed

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-28 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #14 from YunQiang Su --- Ohh, sorry for my misunderstanding. Your patch is correct. The real problem is that, $3 is used by `mips_output_function_prologue`, which is the final for output asm source code, and thus the IRA pass cannot

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-27 Thread mschiffer--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #13 from Matthias Schiffer --- I don't think the register used matters - changing it may hide the bug in specific instances, but it does not fix the root cause. I've now built a simpler reproducer which still seems to exhibit the

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-26 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #12 from YunQiang Su --- You are right: the decision to use $6 is too late. So let's force to use it in expand pass. ``` diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index b63d40a357b..84ff29cd62b 100644 ---

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-26 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #11 from YunQiang Su --- (In reply to YunQiang Su from comment #8) > Ohh, In fact we should use $28 if TARGET_USE_GOT. > > Can you help to test this patch? > > ``` > diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc >

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-26 Thread mschiffer--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #10 from Matthias Schiffer --- (In reply to YunQiang Su from comment #8) > Ohh, In fact we should use $28 if TARGET_USE_GOT. > > Can you help to test this patch? > > ``` > diff --git a/gcc/config/mips/mips.cc

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-25 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #9 from YunQiang Su --- (In reply to Matthias Schiffer from comment #7) > (In reply to YunQiang Su from comment #6) > > The attached patch cannot work now. > > > > It is not correct, and it happened work due to good luck that the

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-25 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #8 from YunQiang Su --- Ohh, In fact we should use $28 if TARGET_USE_GOT. Can you help to test this patch? ``` diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index b63d40a357b..fe8641d3916 100644 ---

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-25 Thread mschiffer--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #7 from Matthias Schiffer --- (In reply to YunQiang Su from comment #6) > The attached patch cannot work now. > > It is not correct, and it happened work due to good luck that the same > register was allocated for these 2

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-25 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #6 from YunQiang Su --- The attached patch cannot work now. It is not correct, and it happened work due to good luck that the same register was allocated for these 2 instructions.

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2024-05-22 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 YunQiang Su changed: What|Removed |Added Last reconfirmed||2024-05-22 CC|

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2018-03-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 Eric Botcazou changed: What|Removed |Added CC||clm at codesourcery dot com,

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2018-03-12 Thread nbd at nbd dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 Felix Fietkau changed: What|Removed |Added CC||nbd at nbd dot name --- Comment #3 from

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2018-03-10 Thread mschif...@universe-factory.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #2 from Matthias Schiffer --- The problem seems to be that the gp init sequence li $2,%hi(_gp_disp) addiu $3,$pc,%lo(_gp_disp) sll $2,16 addu$2,$3 is

[Bug target/84790] Miscompilation for MIPS16 with -fpic and -Os or -O2

2018-03-10 Thread mschif...@universe-factory.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790 --- Comment #1 from Matthias Schiffer --- Issue still present in gcc version 8.0.1 20180310 (experimental) (GCC). Again, output it identical to that of GCC 5 and 7.