]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/init-regs.c
rtl-optimization: Fix uninitialized use of opaque mode variable ICE [PR98872]
authorPeter Bergner <bergner@linux.ibm.com>
Mon, 15 Feb 2021 16:38:33 +0000 (10:38 -0600)
committerPeter Bergner <bergner@linux.ibm.com>
Mon, 15 Feb 2021 16:39:24 +0000 (10:39 -0600)
commita33927c9ab4af3f4595251ce0c8ba54db821b039
tree5f79735742d5e3d77c1993dbbce39b08027367e5
parentcc9a0a3d79d6abb08753a819c9ea21a25015e962
rtl-optimization: Fix uninitialized use of opaque mode variable ICE [PR98872]

The initialize_uninitialized_regs function emits (set (reg:) (CONST0_RTX))
for all uninitialized pseudo uses.  However, some modes (eg, opaque modes)
may not have a CONST0_RTX defined, leading to an ICE when we try and create
the initialization insn.  The fix is to skip emitting the initialization
if there is no CONST0_RTX defined for the mode.

2021-02-15  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR rtl-optimization/98872
* init-regs.c (initialize_uninitialized_regs): Skip initialization
if CONST0_RTX is NULL.

gcc/testsuite/
PR rtl-optimization/98872
* gcc.target/powerpc/pr98872.c: New test.
gcc/init-regs.c
gcc/testsuite/gcc.target/powerpc/pr98872.c [new file with mode: 0644]