gccrs: intrinsic: Add arith_offset

This patch implements the 'arith_offset' compiler intrinsic. It moves a
pointer forward or backward by a given number of elements. It does not
cause Undefined Behavior if the pointer goes out of bounds.

gcc/rust/ChangeLog:

	* backend/rust-compile-intrinsic.cc (generic_intrinsics): Add
	arith_offset handler to map.
	* backend/rust-intrinsic-handlers.cc (arith_offset_handler): New
	function.
	* backend/rust-intrinsic-handlers.h (arith_offset_handler): New
	declaration.
	* typecheck/rust-hir-type-check-intrinsic.cc
	(IntrinsicChecker::intrinsic_rules): Add arith_offset rule.
	* util/rust-intrinsic-values.h (class Intrinsics): Add
	ARITH_OFFSET constexpr.

gcc/testsuite/ChangeLog:

	* rust/execute/arith-offset.rs: New test.

Signed-off-by: Enes Cevik <enes@nsvke.com>
6 files changed