On Thu, May 6, 2021 at 5:29 AM Jim Wilson <j...@sifive.com> wrote:
>
> On Fri, Apr 30, 2021 at 4:10 PM Christoph Müllner via Gcc-patches 
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> On Sat, May 1, 2021 at 12:48 AM Jeff Law <jeffreya...@gmail.com> wrote:
>> > On 4/26/2021 5:38 AM, Christoph Muellner via Gcc-patches wrote:
>> > > [ree] PR rtl-optimization/100264: Handle more PARALLEL SET expressions
>> > >
>> > >          PR rtl-optimization/100264
>> > >          * ree.c (get_sub_rtx): Ignore SET expressions without register
>> > >          destinations.
>> > >          (merge_def_and_ext): Eliminate destination check for register
>> > >          as such SET expressions can't occur anymore.
>> > >          (combine_reaching_defs): Likewise.
>> >
>> > This is pretty sensible.  Do you have commit privs for GCC?
>
>
> This looks reasonable to me also.  But I tried a build and check with an 
> rv64gc/lp64d linux toolchain built from riscv-gnu-toolchain and I get two 
> extra failures in the gfortran testsuite.
>
> /scratch/jimw/fsf-testing/patched/riscv-gcc/gcc/testsuite/gfortran.dg/typebound\
> _operator_3.f03:93:21: internal compiler error: in get_sub_rtx, at ree.c:705^M
> 0x15664f8 get_sub_rtx^M
>         ../../../patched/riscv-gcc/gcc/ree.c:705^M
> 0x15672ce merge_def_and_ext^M
>         ../../../patched/riscv-gcc/gcc/ree.c:719^M
> 0x15672ce combine_reaching_defs^M
>         ../../../patched/riscv-gcc/gcc/ree.c:1020^M
> 0x1568308 find_and_remove_re^M
>         ../../../patched/riscv-gcc/gcc/ree.c:1319^M
> 0x1568308 rest_of_handle_ree^M
>         ../../../patched/riscv-gcc/gcc/ree.c:1390^M
> 0x1568308 execute^M
>         ../../../patched/riscv-gcc/gcc/ree.c:1418^M
> Please submit a full bug report,^M
> with preprocessed source if appropriate.^M
> Please include the complete backtrace with any bug report.^M
> See <https://gcc.gnu.org/bugs/> for instructions.^M
> compiler exited with status 1
> FAIL: gfortran.dg/typebound_operator_3.f03   -Os  (internal compiler error)
> FAIL: gfortran.dg/typebound_operator_3.f03   -Os  (test for excess errors)

The issue comes from the assertion at the end of get_sub_rtx().
It is not valid anymore, because it is possible to have PARALLEL expressions
without a single SET expression for a register. Without my patch, we would
trigger this assertion if there would be a PARALLEL expression without any SET.

My solution is to eliminate the assertion, as the function is supposed
to return NULL in case no matching SET is found (even before my patch).
This also shortens the whole function a bit because the logic for
non-PARALLEL SETs
can be simplified.

Thanks,
Christoph

Reply via email to