gccrs: backend: Add overflow checks to every arithmetic operation
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow
checks logic.
(CompileExpr::array_copied_expr): Insert overflow checks logic.
* backend/rust-compile-item.cc (CompileItem::visit): Insert overflow
checks logic.
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): Insert
overflow checks logic.
* rust-gcc.cc (Gcc_backend::arithmetic_or_logical_expression): Differentiate
existing function from `arithmetic_or_logical_expression_checked`.
This function does insert perform overflow checks.
(Gcc_backend::arithmetic_or_logical_expression_checked): New
function.
(is_overflowing_expr): New function. Check if an expression is an
overflowing one (ADD, SUB, MUL).
(fetch_overflow_builtins): New function.
* rust-backend.h: Declare `arithmetic_or_logical_expression_checked` in
abstract `Backend` class.
gcc/testsuite/ChangeLog:
* rust/debug/win64-abi.rs: Fix assertion to take into account
overflow builtins
* rust/compile/torture/macro-issue1426.rs: Moved to...
* rust/execute/torture/macro-issue1426.rs: ...here.
* rust/execute/torture/overflow1.rs: New test.