>From 6602fc076a883cf0cd20a37655a6bd9c146a2770 Mon Sep 17 00:00:00 2001 From: Bob Dubner <rdub...@symas.com> Date: Fri, 4 Apr 2025 18:33:42 -0400 Subject: [PATCH] cobol: Set compile-time and run-time signable_e bits the same for RETURN-CODE.
This fix reverts the recent cobol_langhook_post_options change setting flag_strict_aliasing = 0. It isn't necessary. gcc/cobol * cobol1.cc: Eliminate cobol_langhook_post_options. * symbols.cc: Definition of RETURN-CODE special register sets ::attr member to signable_e. --- gcc/cobol/cobol1.cc | 19 ------------------- gcc/cobol/symbols.cc | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc index d175ab11e3f..0d07c460d41 100644 --- a/gcc/cobol/cobol1.cc +++ b/gcc/cobol/cobol1.cc @@ -646,22 +646,6 @@ cobol_get_sarif_source_language(const char *) return "cobol"; } -bool -cobol_langhook_post_options(const char**) - { - // This flag, when set to 0, results in calls to gg_exit working properly. - // I don't know why it is necessary. There is something going on with the - // definition of __gg__data_return_code in constants.cc, and with how it - // is used through var_decl_return_code in genapi.cc. Without it, the value - // delivered to exit@PLT is zero, and not __gg__data_return_code - // Dubner, 2025-04-04. - flag_strict_aliasing = 0; - - /* Returning false means that the backend should be used. */ - return false; - } - - #undef LANG_HOOKS_BUILTIN_FUNCTION #undef LANG_HOOKS_GETDECLS #undef LANG_HOOKS_GLOBAL_BINDINGS_P @@ -676,7 +660,6 @@ cobol_langhook_post_options(const char**) ////#undef LANG_HOOKS_TYPE_FOR_SIZE #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME #undef LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE -#undef LANG_HOOKS_POST_OPTIONS // We use GCC in the name, not GNU, as others do, // because "GnuCOBOL" refers to a different GNU project. @@ -702,8 +685,6 @@ cobol_langhook_post_options(const char**) #define LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE cobol_get_sarif_source_language -#define LANG_HOOKS_POST_OPTIONS cobol_langhook_post_options - struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; #include "gt-cobol-cobol1.h" diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc index 2373bfe6cc5..50431251a0f 100644 --- a/gcc/cobol/symbols.cc +++ b/gcc/cobol/symbols.cc @@ -2350,7 +2350,7 @@ symbol_table_init(void) { 0, {}, {2,2,2,0, NULL}, NULL }, { 0, FldNumericBin5, FldInvalid, 0, 0, 0, 0, nonarray, 0, "UPSI-0", 0, {}, {2,2,4,0, NULL}, NULL }, - { 0, FldNumericBin5, FldInvalid, 0, 0, 0, 0, nonarray, 0, "RETURN-CODE", + { 0, FldNumericBin5, FldInvalid, signable_e, 0, 0, 0, nonarray, 0, "RETURN-CODE", 0, {}, {2,2,4,0, NULL}, NULL }, { 0, FldNumericBin5, FldInvalid, 0, 0, 0, 0, nonarray, 0, "LINAGE-COUNTER", 0, {}, {2,2,4,0, NULL}, NULL }, -- 2.34.1