rs6000: Don't ICE when we disassemble an MMA variable [PR101322]
commit2985049049f12b0aa3366ca244d387820385b9e8
authorPeter Bergner <bergner@linux.ibm.com>
Thu, 1 Sep 2022 02:14:36 +0000 (31 21:14 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Thu, 1 Sep 2022 02:15:59 +0000 (31 21:15 -0500)
tree353205dd0fa6f0f681b5e849111c99b451789de4
parente8c83ab9d5142a305bbd75c7ff0e41eae38433df
rs6000: Don't ICE when we disassemble an MMA variable [PR101322]

When we expand an MMA disassemble built-in with C++ using a pointer that
is cast to a valid MMA type, the type isn't passed down to the expand
machinery and we end up using the base type of the pointer which leads to
an ICE.  This patch enforces we always use the correct MMA type regardless
of the pointer type being used.

2022-08-31  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/101322
* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_mma_builtin):
Enforce the use of a valid MMA pointer type.

gcc/testsuite/
PR target/101322
* g++.target/powerpc/pr101322.C: New test.
gcc/config/rs6000/rs6000-builtin.cc
gcc/testsuite/g++.target/powerpc/pr101322.C [new file with mode: 0644]