aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-02-24 16:14:30 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-30 09:12:18 +0200
commit0e58d85c40223fcdde298aaa443d8d5f7863ab16 (patch)
tree3ea79e0eb26f8ed1b4b1f0e60796ae60d60be705 /gcc/ada/gcc-interface/trans.cc
parente2c9982eef42bc6421c7e9539983a743c7f7a13a (diff)
downloadgcc-0e58d85c40223fcdde298aaa443d8d5f7863ab16.zip
gcc-0e58d85c40223fcdde298aaa443d8d5f7863ab16.tar.gz
gcc-0e58d85c40223fcdde298aaa443d8d5f7863ab16.tar.bz2
ada: Fix minor issue with Mod operator
gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu) <N_Op_Mod>: Test the precision of the operation rather than that of the result type.
Diffstat (limited to 'gcc/ada/gcc-interface/trans.cc')
-rw-r--r--gcc/ada/gcc-interface/trans.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index 8c8a78f..1c3c6c0 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -7095,9 +7095,9 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_rhs = convert (gnu_count_type, gnu_rhs);
gnu_max_shift
= convert (TREE_TYPE (gnu_rhs), TYPE_SIZE (gnu_type));
- /* If the result type is larger than a word, then declare the dependence
- on the libgcc routine. */
- if (TYPE_PRECISION (gnu_result_type) > BITS_PER_WORD)
+ /* If the result type is larger than a word, then declare the
+ dependence on the libgcc routine. */
+ if (TYPE_PRECISION (gnu_type) > BITS_PER_WORD)
Check_Restriction_No_Dependence_On_System (Name_Gcc, gnat_node);
}
@@ -7114,7 +7114,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* If this is a modulo/remainder and the result type is larger than a
word, then declare the dependence on the libgcc routine. */
else if ((kind == N_Op_Mod ||kind == N_Op_Rem)
- && TYPE_PRECISION (gnu_result_type) > BITS_PER_WORD)
+ && TYPE_PRECISION (gnu_type) > BITS_PER_WORD)
Check_Restriction_No_Dependence_On_System (Name_Gcc, gnat_node);
/* Pending generic support for efficient vector logical operations in