[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 Kewen Lin changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #11 from Kewen Lin --- Should be fixed on trunk and active release branches.
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 --- Comment #10 from GCC Commits --- The releases/gcc-11 branch has been updated by Kewen Lin : https://gcc.gnu.org/g:02f1b5361188c9d833cef39caf723d31d44ba5d5 commit r11-11363-g02f1b5361188c9d833cef39caf723d31d44ba5d5 Author: Kewen Lin Date: Mon Apr 8 21:01:36 2024 -0500 rs6000: Fix wrong align passed to build_aligned_type [PR88309] As the comments in PR88309 show, there are two oversights in rs6000_gimple_fold_builtin that pass align in bytes to build_aligned_type but which actually requires align in bits, it causes unexpected ICE or hanging in function is_miss_rate_acceptable due to zero align_unit value. This patch is to fix them by converting bytes to bits, add an assertion on positive align_unit value and notes function build_aligned_type requires align measured in bits in its function comment. PR target/88309 Co-authored-by: Andrew Pinski gcc/ChangeLog: * config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin): Fix wrong align passed to function build_aligned_type. * tree-ssa-loop-prefetch.c (is_miss_rate_acceptable): Add an assertion to ensure align_unit should be positive. * tree.c (build_qualified_type): Update function comments. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr88309.c: New test. (cherry picked from commit 26eb5f8fd173e2425ae7505528fc426de4b7e34c)
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 --- Comment #9 from GCC Commits --- The releases/gcc-12 branch has been updated by Kewen Lin : https://gcc.gnu.org/g:43c8cb0e003996b3a7a9f98923f602561f3f0ec7 commit r12-10393-g43c8cb0e003996b3a7a9f98923f602561f3f0ec7 Author: Kewen Lin Date: Mon Apr 8 21:01:36 2024 -0500 rs6000: Fix wrong align passed to build_aligned_type [PR88309] As the comments in PR88309 show, there are two oversights in rs6000_gimple_fold_builtin that pass align in bytes to build_aligned_type but which actually requires align in bits, it causes unexpected ICE or hanging in function is_miss_rate_acceptable due to zero align_unit value. This patch is to fix them by converting bytes to bits, add an assertion on positive align_unit value and notes function build_aligned_type requires align measured in bits in its function comment. PR target/88309 Co-authored-by: Andrew Pinski gcc/ChangeLog: * config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_builtin): Fix wrong align passed to function build_aligned_type. * tree-ssa-loop-prefetch.cc (is_miss_rate_acceptable): Add an assertion to ensure align_unit should be positive. * tree.cc (build_qualified_type): Update function comments. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr88309.c: New test.
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 --- Comment #8 from GCC Commits --- The releases/gcc-13 branch has been updated by Kewen Lin : https://gcc.gnu.org/g:a9f174f01f25fa6df989707dc2fec29ef78aad24 commit r13-8646-ga9f174f01f25fa6df989707dc2fec29ef78aad24 Author: Kewen Lin Date: Mon Apr 8 21:01:36 2024 -0500 rs6000: Fix wrong align passed to build_aligned_type [PR88309] As the comments in PR88309 show, there are two oversights in rs6000_gimple_fold_builtin that pass align in bytes to build_aligned_type but which actually requires align in bits, it causes unexpected ICE or hanging in function is_miss_rate_acceptable due to zero align_unit value. This patch is to fix them by converting bytes to bits, add an assertion on positive align_unit value and notes function build_aligned_type requires align measured in bits in its function comment. PR target/88309 Co-authored-by: Andrew Pinski gcc/ChangeLog: * config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_builtin): Fix wrong align passed to function build_aligned_type. * tree-ssa-loop-prefetch.cc (is_miss_rate_acceptable): Add an assertion to ensure align_unit should be positive. * tree.cc (build_qualified_type): Update function comments. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr88309.c: New test.
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 --- Comment #7 from GCC Commits --- The master branch has been updated by Kewen Lin : https://gcc.gnu.org/g:26eb5f8fd173e2425ae7505528fc426de4b7e34c commit r14-9850-g26eb5f8fd173e2425ae7505528fc426de4b7e34c Author: Kewen Lin Date: Mon Apr 8 21:01:36 2024 -0500 rs6000: Fix wrong align passed to build_aligned_type [PR88309] As the comments in PR88309 show, there are two oversights in rs6000_gimple_fold_builtin that pass align in bytes to build_aligned_type but which actually requires align in bits, it causes unexpected ICE or hanging in function is_miss_rate_acceptable due to zero align_unit value. This patch is to fix them by converting bytes to bits, add an assertion on positive align_unit value and notes function build_aligned_type requires align measured in bits in its function comment. PR target/88309 Co-authored-by: Andrew Pinski gcc/ChangeLog: * config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_builtin): Fix wrong align passed to function build_aligned_type. * tree-ssa-loop-prefetch.cc (is_miss_rate_acceptable): Add an assertion to ensure align_unit should be positive. * tree.cc (build_qualified_type): Update function comments. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr88309.c: New test.
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 Kewen Lin changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |linkw at gcc dot gnu.org --- Comment #6 from Kewen Lin --- (In reply to Andrew Pinski from comment #5) > (In reply to Kewen Lin from comment #4) > > Hi Andrew, thanks for digging into this! William has not worked on GCC > > project any more, will you make a patch for this? > > I don't have time to test it really. No problem, I'll work on this.
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 --- Comment #5 from Andrew Pinski --- (In reply to Kewen Lin from comment #4) > (In reply to Andrew Pinski from comment #3) > > Found it: > > /* In GIMPLE the type of the MEM_REF specifies the alignment. The > > required alignment (power) is 4 bytes regardless of data type. */ > > tree align_ltype = build_aligned_type (lhs_type, 4); > > > > That should be 4*8 instead of just 4. > > > > There are 2 build_aligned_type in rs6000-builtins.cc which uses the wrong > > alignment; thinking it was the alignment argument was bytes rather than > > bits. > > > > Introduced by r9-2375-g3f7a77cd20d07c which means this is a regression. > > Hi Andrew, thanks for digging into this! William has not worked on GCC > project any more, will you make a patch for this? I don't have time to test it really.
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 Kewen Lin changed: What|Removed |Added CC||linkw at gcc dot gnu.org --- Comment #4 from Kewen Lin --- (In reply to Andrew Pinski from comment #3) > Found it: > /* In GIMPLE the type of the MEM_REF specifies the alignment. The > required alignment (power) is 4 bytes regardless of data type. */ > tree align_ltype = build_aligned_type (lhs_type, 4); > > That should be 4*8 instead of just 4. > > There are 2 build_aligned_type in rs6000-builtins.cc which uses the wrong > alignment; thinking it was the alignment argument was bytes rather than bits. > > Introduced by r9-2375-g3f7a77cd20d07c which means this is a regression. Hi Andrew, thanks for digging into this! William has not worked on GCC project any more, will you make a patch for this?
[Bug target/88309] [11/12/13/14 Regression] ICE: Floating point exception (in is_miss_rate_acceptable), target assigning alignent of 4 bits(!) to vector
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88309 Andrew Pinski changed: What|Removed |Added CC||willschm at gcc dot gnu.org Summary|ICE: Floating point |[11/12/13/14 Regression] |exception (in |ICE: Floating point |is_miss_rate_acceptable), |exception (in |target assigning alignent |is_miss_rate_acceptable), |of 4 bits(!) to vector |target assigning alignent ||of 4 bits(!) to vector Known to fail||9.1.0 Target Milestone|--- |11.5 Known to work||8.5.0 --- Comment #3 from Andrew Pinski --- Found it: /* In GIMPLE the type of the MEM_REF specifies the alignment. The required alignment (power) is 4 bytes regardless of data type. */ tree align_ltype = build_aligned_type (lhs_type, 4); That should be 4*8 instead of just 4. There are 2 build_aligned_type in rs6000-builtins.cc which uses the wrong alignment; thinking it was the alignment argument was bytes rather than bits. Introduced by r9-2375-g3f7a77cd20d07c which means this is a regression.