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
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: