]> 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)
committerRobert Dubner <rdubner@symas.com>
Tue, 29 Jul 2025 16:06:37 +0000 (12:06 -0400)
commit167f3663ccc7d0a5cf2a83e0c29461ca79841e99
tree6fdce8513dea95a182c5ecdacd3ccb54e4fad14d
parentadffa5342315cc642e3c0a35304f7d27f7c4f987
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.

(cherry picked from commit c77d04506e6abdc45969d0ff146204be7485244a)
gcc/cobol/genapi.cc
gcc/cobol/structs.cc
gcc/cobol/structs.h