diff options
author | Bob Dubner <rdubner@symas.com> | 2025-04-09 16:23:53 -0400 |
---|---|---|
committer | Robert Dubner <rdubner@symas.com> | 2025-04-09 17:10:54 -0400 |
commit | 6704d95ec859d9e7480da130bff1e6b58fe37350 (patch) | |
tree | bec33f86f710a880571419701a3d40cc33c28783 /gcc | |
parent | f7738c36710f8084e24cbb1d92acf3b6e5e83ea9 (diff) | |
download | gcc-6704d95ec859d9e7480da130bff1e6b58fe37350.zip gcc-6704d95ec859d9e7480da130bff1e6b58fe37350.tar.gz gcc-6704d95ec859d9e7480da130bff1e6b58fe37350.tar.bz2 |
cobol: Proper comparison of alphanumeric to refmoded numeric-display [PR119682]
gcc/cobol
PR cobol/119682
* genapi.cc: (cobol_compare): Change the call to __gg__compare().
libgcobol
PR cobol/119682
* common-defs.h: Define the REFER_T_REFMOD constant.
* intrinsic.cc: (__gg__max): Change the calls to __gg__compare_2(),
(__gg__min): Likewise, (__gg__ord_min): Likewise,
(__gg__ord_max): Likewise.
* libgcobol.cc: (__gg__compare_2): Change definition of calling
parameters, eliminate separate flag bit for ALL and ADDRESS_OF,
change comparison of alphanumeric to numeric when the numeric
is a refmod.
* libgcobol.h: Change declaration of __gg__compare_2.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cobol/genapi.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc index c91237b..fdf76aa 100644 --- a/gcc/cobol/genapi.cc +++ b/gcc/cobol/genapi.cc @@ -2028,10 +2028,12 @@ cobol_compare( tree return_int, { // None of our explicit comparisons up above worked, so we revert to the // general case: - int leftflags = (left_side_ref.all ? REFER_T_MOVE_ALL : 0) - + (left_side_ref.addr_of ? REFER_T_ADDRESS_OF : 0); - int rightflags = (right_side_ref.all ? REFER_T_MOVE_ALL : 0) - + (right_side_ref.addr_of ? REFER_T_ADDRESS_OF : 0); + int leftflags = (left_side_ref.all ? REFER_T_MOVE_ALL : 0) + + (left_side_ref.addr_of ? REFER_T_ADDRESS_OF : 0) + + (left_side_ref.refmod.from ? REFER_T_REFMOD : 0); + int rightflags = (right_side_ref.all ? REFER_T_MOVE_ALL : 0) + + (right_side_ref.addr_of ? REFER_T_ADDRESS_OF : 0) + + (right_side_ref.refmod.from ? REFER_T_REFMOD : 0); gg_assign( return_int, gg_call_expr( INT, "__gg__compare", @@ -2045,6 +2047,7 @@ cobol_compare( tree return_int, build_int_cst_type(INT, rightflags), integer_zero_node, NULL_TREE)); + compared = true; } // gg_printf(" result is %d\n", return_int, NULL_TREE); |