]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Fix wrong align passed to build_aligned_type [PR88309]
authorKewen Lin <linkw@linux.ibm.com>
Tue, 9 Apr 2024 02:01:36 +0000 (21:01 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 25 Apr 2024 02:32:44 +0000 (21:32 -0500)
commita9f174f01f25fa6df989707dc2fec29ef78aad24
tree3776ed7695a0230d9524f56c93cb5d8a3e8140b3
parent05d92259ee3668769409c52c063628a19fb0b43a
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 <quic_apinski@quicinc.com>
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.
gcc/config/rs6000/rs6000-builtin.cc
gcc/testsuite/gcc.target/powerpc/pr88309.c [new file with mode: 0644]
gcc/tree-ssa-loop-prefetch.cc
gcc/tree.cc