]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Fix up exception handling [PR119364]
authorJakub Jelinek <jakub@redhat.com>
Fri, 2 May 2025 17:10:59 +0000 (19:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 2 May 2025 17:12:20 +0000 (19:12 +0200)
commitc77d04506e6abdc45969d0ff146204be7485244a
tree5fac004aa58e3d25e07f3bb4a8c830240222c34e
parent4704b94fc76b51e79e6fcf63344f70da4d89d75c
cobol: Fix up exception handling [PR119364]

The following patch on top of the
https://gcc.gnu.org/pipermail/gcc-patches/2025-May/682500.html
fixes most of the remaining make check-cobol FAILs in the
i686-linux -> x86_64-linux cross-compiler.

Using the testing environment detailed in
https://gcc.gnu.org/pipermail/gcc-patches/2025-April/680403.html
with this patch I get just cobol.dg/group1/declarative_1.cob FAILs
in i686-linux -> x86_64-linux cross and no FAILs in x86_64-linux
native one.

The patch isn't needed just for cross-compilation with different
hosts, but also on x86_64-linux/aarch64-linux native, because without
it the FE is hashing padding bits which contain random garbage and making
code generation decisions based on that.  That is very much against the
reproduceability requirements.

2025-05-02  Jakub Jelinek  <jakub@redhat.com>

PR cobol/119364
* structs.h (cbl_enabled_exception_type_node): New variable
declaration.
* structs.cc (cbl_enabled_exception_type_node): New variable.
(create_cbl_enabled_exception_t): New function.
(create_our_type_nodes): Initialize cbl_enabled_exception_type_node
using it.
* genapi.cc (stash_exceptions): Don't compare padding bits to
determine if the exceptions are the same as last time.  Use
cbl_enabled_exception_type_node for target size and field offsets
and native_encode_expr to write each field into byte sequence.
gcc/cobol/genapi.cc
gcc/cobol/structs.cc
gcc/cobol/structs.h