https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117886

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>:

https://gcc.gnu.org/g:4d18acf8023ba0495007aa7a6f36d5509a51760b

commit r15-7179-g4d18acf8023ba0495007aa7a6f36d5509a51760b
Author: David Malcolm <dmalc...@redhat.com>
Date:   Fri Jan 24 10:20:16 2025 -0500

    jit: fix for write_reproducer [PR117886]

    The original generated .c reproducer for PR jit/117886 did not compile,
    with:

    main.c: In function âcreate_codeâ:
    main.c:600:9: error: initialization of âgcc_jit_rvalue *â from
incompatible pointer type âgcc_jit_lvalue *â [-Wincompatible-pointer-types]
      600 |         local__1,
          |         ^~~~~~~~

    The issue is that recording::ctor::write_reproducer was missing
    creation of casts to gcc_jit_rvalue * for
    gcc_jit_context_new_array_constructor and
    gcc_jit_context_new_struct_constructor.

    Fixed thusly.

    gcc/jit/ChangeLog:
            PR jit/117886
            * jit-recording.cc (reproducer::get_identifier_as_rvalue): Handle
            null memento.
            (reproducer::get_identifier_as_lvalue): Likewise.
            (reproducer::get_identifier_as_type): Likewise.
            (recording::ctor::write_reproducer): Use get_identifier_as_rvalue
            rather than get_identifier when writing out gcc_jit_rvalue *
            expressions.

    gcc/testsuite/ChangeLog:
            PR jit/117886
            * jit.dg/all-non-failing-tests.h: Add
            test-pr117886-write-reproducer.c.
            * jit.dg/test-pr117886-write-reproducer.c: New test.

    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Reply via email to