[PATCH] rtlanal: Fix up replace_rtx [PR105333]

2022-04-22 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase FAILs, because replace_rtx replaces a REG with CONST_WIDE_INT inside of a SUBREG, which is an invalid transformation because a SUBREG relies on SUBREG_REG having non-VOIDmode but CONST_WIDE_INT has VOIDmode. replace_rtx already has code to deal with it, but it was doing

Re: [PATCH] rtlanal: Fix up replace_rtx [PR105333]

2022-04-22 Thread Richard Biener via Gcc-patches
On Fri, 22 Apr 2022, Jakub Jelinek wrote: > Hi! > > The following testcase FAILs, because replace_rtx replaces a REG with > CONST_WIDE_INT inside of a SUBREG, which is an invalid transformation > because a SUBREG relies on SUBREG_REG having non-VOIDmode but > CONST_WIDE_INT has VOIDmode. > > rep

Re: [PATCH] rtlanal: Fix up replace_rtx [PR105333]

2022-04-22 Thread Eric Botcazou via Gcc-patches
> 2022-04-22 Jakub Jelinek > > PR rtl-optimization/105333 > * rtlanal.cc (replace_rtx): Use simplify_subreg or > simplify_unary_operation if CONST_SCALAR_INT_P rather than just > CONST_INT_P. > > * gcc.dg/pr105333.c: New test. OK, thanks. -- Eric Botcazou