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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:1bfc026035e6bade36538077dc1dd4f9baff0bf2

commit r15-9172-g1bfc026035e6bade36538077dc1dd4f9baff0bf2
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Apr 3 08:32:09 2025 +0200

    fold-const, cobol: Add native_encode_wide_int and use it in COBOL FE
[PR119242]

    As has been mentioned earlier, various parts of the COBOL FE and the
library
    aren't endian clean.  In the library that means that for now we have to
    live with no support for big endian targets, but in the FE that means
    that as well as not being able to build cross-compilers from big endian
    or pdp endian hosts to little endian targets which are otherwise supported.

    The following patch attempts to fix one such spot, where it wants to encode
    in target byte ordering wide_int constants into 1, 2, 4, 8 or 16 bytes.

    We could wide_int_to_tree and then native_encode_expr, but so that we don't
    need to build the constants, the following patch exports from fold-const.cc
    a helper for native_encode_int which takes type and const wide_int_ref
    reference rather than an expression.

    2025-04-03  Jakub Jelinek  <ja...@redhat.com>

            PR cobol/119242
    gcc/
            * fold-const.h (native_encode_wide_int): Declare.
            * fold-const.cc (native_encode_wide_int): New function.
            (native_encode_int): Use it.
    gcc/cobol/
            * genapi.cc (binary_initial_from_float128): Use
            native_encode_wide_int.

Reply via email to