[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |11.2 Status|UNCONFIRMED |RESOLVED Keywords||ice-on-valid-code Resolution|--- |FIXED --- Comment #8 from Andrew Pinski --- Fixed so closing as such.
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 --- Comment #7 from CVS Commits --- The releases/gcc-11 branch has been updated by Andreas Krebbel : https://gcc.gnu.org/g:e43f47686980e9d0081aa765b619bdc89189b51a commit r11-8448-ge43f47686980e9d0081aa765b619bdc89189b51a Author: Andreas Krebbel Date: Tue Apr 27 10:09:06 2021 +0200 PR100281 C++: Fix SImode pointer handling The problem appears to be triggered by two locations in the front-end where non-POINTER_SIZE pointers aren't handled right now. 1. An assertion in strip_typedefs is triggered because the alignment of the types don't match. This in turn is caused by creating the new type with build_pointer_type instead of taking the type of the original pointer into account. 2. An assertion in cp_convert_to_pointer is triggered which expects the target type to always have POINTER_SIZE. gcc/cp/ChangeLog: PR c++/100281 * cvt.c (cp_convert_to_pointer): Use the size of the target pointer type. * tree.c (cp_build_reference_type): Call cp_build_reference_type_for_mode with VOIDmode. (cp_build_reference_type_for_mode): Rename from cp_build_reference_type. Add MODE argument and invoke build_reference_type_for_mode. (strip_typedefs): Use build_pointer_type_for_mode and cp_build_reference_type_for_mode for pointers and references. gcc/ChangeLog: PR c++/100281 * tree.c (build_reference_type_for_mode) (build_pointer_type_for_mode): Pick pointer mode if MODE argument is VOIDmode. (build_reference_type, build_pointer_type): Invoke build_*_type_for_mode with VOIDmode. gcc/testsuite/ChangeLog: PR c++/100281 * g++.target/s390/pr100281-1.C: New test. * g++.target/s390/pr100281-2.C: New test. (cherry picked from commit 720dff974ea0487c35c0a4bfa527f30df5066ce1)
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 --- Comment #6 from CVS Commits --- The master branch has been updated by Andreas Krebbel : https://gcc.gnu.org/g:720dff974ea0487c35c0a4bfa527f30df5066ce1 commit r12-857-g720dff974ea0487c35c0a4bfa527f30df5066ce1 Author: Andreas Krebbel Date: Tue Apr 27 10:09:06 2021 +0200 PR100281 C++: Fix SImode pointer handling The problem appears to be triggered by two locations in the front-end where non-POINTER_SIZE pointers aren't handled right now. 1. An assertion in strip_typedefs is triggered because the alignment of the types don't match. This in turn is caused by creating the new type with build_pointer_type instead of taking the type of the original pointer into account. 2. An assertion in cp_convert_to_pointer is triggered which expects the target type to always have POINTER_SIZE. gcc/cp/ChangeLog: PR c++/100281 * cvt.c (cp_convert_to_pointer): Use the size of the target pointer type. * tree.c (cp_build_reference_type): Call cp_build_reference_type_for_mode with VOIDmode. (cp_build_reference_type_for_mode): Rename from cp_build_reference_type. Add MODE argument and invoke build_reference_type_for_mode. (strip_typedefs): Use build_pointer_type_for_mode and cp_build_reference_type_for_mode for pointers and references. gcc/ChangeLog: PR c++/100281 * tree.c (build_reference_type_for_mode) (build_pointer_type_for_mode): Pick pointer mode if MODE argument is VOIDmode. (build_reference_type, build_pointer_type): Invoke build_*_type_for_mode with VOIDmode. gcc/testsuite/ChangeLog: PR c++/100281 * g++.target/s390/pr100281-1.C: New test. * g++.target/s390/pr100281-2.C: New test.
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 Andreas Krebbel changed: What|Removed |Added Attachment #50685|0 |1 is obsolete|| --- Comment #5 from Andreas Krebbel --- Created attachment 50689 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50689=edit Fixed patch with testcase
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 Richard Biener changed: What|Removed |Added Target||s390 --- Comment #4 from Richard Biener --- I see.
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 --- Comment #3 from Andreas Krebbel --- This is a hard requirement for the z/TPF operating system supported as part of our IBM Z backend. It happens to work for many years already and they make extensive use of it.
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 --- Comment #2 from Richard Biener --- That said, use integer types.
[Bug c++/100281] ICE with SImode pointer assignment in C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100281 --- Comment #1 from Richard Biener --- I don't think different sized pointers are properly handled anywhere. It may just happen to "work". Why would you need such beasts? There's only one intptr_t and only one POINTERS_EXTEND_UNSIGNED, only one ptr_mode.