[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-07-04 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 Xi Ruoyao changed: What|Removed |Added Target Milestone|--- |12.2 --- Comment #13 from Xi Ruoyao ---

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-29 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 Xi Ruoyao changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-28 Thread chenglulu at loongson dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #11 from chenglulu --- > Otherwise LGTM. As the port maintainer you can push it directly into > master. Normally we should bootstrap and regtest before applying a patch, > but currently the bootstrap is blocked by PR106096 :(.

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-28 Thread xry111 at mengyan1223 dot wang via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #10 from Xi Ruoyao --- (In reply to chenglulu from comment #9) > Created attachment 53206 [details] > use LU52I_B and LU32I_B instead of hard coding those long > + codes[cost].value = (value & LU32I_B) > + | (sign51 ?

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-27 Thread chenglulu at loongson dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #9 from chenglulu --- Created attachment 53206 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53206=edit use LU52I_B and LU32I_B instead of hard coding those long

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-27 Thread chenglulu at loongson dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #8 from chenglulu --- > You can reuse LU32I_B and LU52I_B instead of hard coding those long > constants :). I have fixed it, thanks!:)

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-27 Thread xry111 at mengyan1223 dot wang via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #7 from Xi Ruoyao --- (In reply to chenglulu from comment #6) > Created attachment 53205 [details] > 0001-Fix-bug-for-PR16097.patch You can reuse LU32I_B and LU52I_B instead of hard coding those long constants :).

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-27 Thread chenglulu at loongson dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #6 from chenglulu --- Created attachment 53205 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53205=edit 0001-Fix-bug-for-PR16097.patch

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-26 Thread xry111 at mengyan1223 dot wang via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #4 from Xi Ruoyao --- BTW I found this issue trying to triage PR106096, but I think it's not related to this one.

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-26 Thread xry111 at mengyan1223 dot wang via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #5 from Xi Ruoyao --- And it actually does not need a reproducer: "x << 32 >> 32" for sign-extension is undefined by C++ standard if x is negative: > The value of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are >

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-26 Thread xry111 at mengyan1223 dot wang via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #3 from Xi Ruoyao --- (In reply to Andrew Pinski from comment #2) > by using the --with-build-config=bootstrap-ubsan option at configure time or > BUILD_CONFIG variable to build time. > > See https://gcc.gnu.org/install/build.html

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #2 from Andrew Pinski --- by using the --with-build-config=bootstrap-ubsan option at configure time or BUILD_CONFIG variable to build time. See https://gcc.gnu.org/install/build.html

[Bug target/106097] undefined behaviors regarding integer shifts in loongarch_build_integer

2022-06-26 Thread chenglulu at loongson dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097 --- Comment #1 from chenglulu --- How can I reproduce the problem? Thanks! Lulu Cheng