aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-05-28 08:13:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-05-28 08:13:37 +0000
commitf552aa626fbfa268b819395d1c5d25ca3ca78428 (patch)
treef1237d27ef9ffe35c50038156699559cfa001699 /gcc/ada/gcc-interface/trans.c
parent81edaf2fc6328f5eba841744da40c3f0dd4d174f (diff)
downloadgcc-f552aa626fbfa268b819395d1c5d25ca3ca78428.zip
gcc-f552aa626fbfa268b819395d1c5d25ca3ca78428.tar.gz
gcc-f552aa626fbfa268b819395d1c5d25ca3ca78428.tar.bz2
trans.c (gnat_to_gnu): Remove superfluous tests on Backend_Overflow_Checks_On_Target and rework comments.
* gcc-interface/trans.c (gnat_to_gnu): Remove superfluous tests on Backend_Overflow_Checks_On_Target and rework comments. From-SVN: r271689
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index da1da50..f5cc318 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -7587,16 +7587,15 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_rhs = convert (gnu_type, gnu_rhs);
}
- /* Instead of expanding overflow checks for addition, subtraction
- and multiplication itself, the front end will leave this to
- the back end when Backend_Overflow_Checks_On_Target is set. */
+ /* For signed integer addition, subtraction and multiplication, do an
+ overflow check if required. */
if (Do_Overflow_Check (gnat_node)
- && Backend_Overflow_Checks_On_Target
&& (code == PLUS_EXPR || code == MINUS_EXPR || code == MULT_EXPR)
&& !TYPE_UNSIGNED (gnu_type)
&& !FLOAT_TYPE_P (gnu_type))
- gnu_result = build_binary_op_trapv (code, gnu_type,
- gnu_lhs, gnu_rhs, gnat_node);
+ gnu_result
+ = build_binary_op_trapv (code, gnu_type, gnu_lhs, gnu_rhs,
+ gnat_node);
else
{
/* Some operations, e.g. comparisons of arrays, generate complex
@@ -7657,19 +7656,17 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_expr = gnat_to_gnu (Right_Opnd (gnat_node));
gnu_result_type = get_unpadded_type (Etype (gnat_node));
- /* Instead of expanding overflow checks for negation and absolute
- value itself, the front end will leave this to the back end
- when Backend_Overflow_Checks_On_Target is set. */
+ /* For signed integer negation and absolute value, do an overflow check
+ if required. */
if (Do_Overflow_Check (gnat_node)
- && Backend_Overflow_Checks_On_Target
&& !TYPE_UNSIGNED (gnu_result_type)
&& !FLOAT_TYPE_P (gnu_result_type))
gnu_result
- = build_unary_op_trapv (gnu_codes[kind],
- gnu_result_type, gnu_expr, gnat_node);
+ = build_unary_op_trapv (gnu_codes[kind], gnu_result_type, gnu_expr,
+ gnat_node);
else
- gnu_result = build_unary_op (gnu_codes[kind],
- gnu_result_type, gnu_expr);
+ gnu_result
+ = build_unary_op (gnu_codes[kind], gnu_result_type, gnu_expr);
break;
case N_Allocator: