]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove unnecessary SIDE_EFFECTS/READONLY macros
authorMael Cravero <mael.cravero@embecosm.com>
Tue, 30 Apr 2024 10:04:50 +0000 (12:04 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:22 +0000 (16:35 +0100)
Closes #2357

gcc/rust/ChangeLog:

* rust-gcc.cc: remove unnecessary TREE_SIDE_EFFECTS and TREE_READONLY
macros used in arithmetic overflow checks.

Signed-off-by: Mael Cravero <mael.cravero@embecosm.com>
gcc/rust/rust-gcc.cc

index d2410768c32f9d97a31363a533ec1d3846193aae..273ab7889b086d70c8096bf1a0b3798f3f39b8e1 100644 (file)
@@ -1149,15 +1149,6 @@ fetch_overflow_builtins (ArithmeticOrLogicalOperator op)
   rust_assert (abort);
   rust_assert (builtin);
 
-  // FIXME: ARTHUR: This is really ugly. The builtin context should take care of
-  // that
-  TREE_SIDE_EFFECTS (abort) = 1;
-  TREE_READONLY (abort) = 0;
-
-  // FIXME: ARTHUR: Same here. Remove these!
-  TREE_SIDE_EFFECTS (builtin) = 1;
-  TREE_READONLY (builtin) = 0;
-
   return {abort, builtin};
 }
 
@@ -1192,10 +1183,6 @@ arithmetic_or_logical_expression_checked (ArithmeticOrLogicalOperator op,
 
   auto abort_call = build_call_expr_loc (location, abort, 0);
 
-  // FIXME: ARTHUR: Is that needed?
-  TREE_SIDE_EFFECTS (abort_call) = 1;
-  TREE_READONLY (abort_call) = 0;
-
   auto builtin_call
     = build_call_expr_loc (location, builtin, 3, left, right, result_ref);
   auto overflow_check
@@ -1205,10 +1192,6 @@ arithmetic_or_logical_expression_checked (ArithmeticOrLogicalOperator op,
   auto if_block = build3_loc (location, COND_EXPR, void_type_node,
                              overflow_check, abort_call, NULL_TREE);
 
-  // FIXME: ARTHUR: Needed?
-  TREE_SIDE_EFFECTS (if_block) = 1;
-  TREE_READONLY (if_block) = 0;
-
   return if_block;
 }