From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id B064D3858CDA; Fri, 12 Aug 2022 09:23:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B064D3858CDA Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Revert "Ensure we set TREE_SIDE_EFFECTS on call expressions" X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 70a0039b82b3419820359c8a1552470e48b458f6 X-Git-Newrev: 2f15ae7493579ac55d2a1e11ece43abaf4e1bc06 Message-Id: <20220812092312.B064D3858CDA@sourceware.org> Date: Fri, 12 Aug 2022 09:23:12 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2022 09:23:12 -0000 https://gcc.gnu.org/g:2f15ae7493579ac55d2a1e11ece43abaf4e1bc06 commit 2f15ae7493579ac55d2a1e11ece43abaf4e1bc06 Author: Philip Herron Date: Thu Aug 11 16:15:35 2022 +0100 Revert "Ensure we set TREE_SIDE_EFFECTS on call expressions" This reverts commit f891a13aa2af912584176d2c595c295b77ff5ff9. This fix ensures the code is added to the block but still as the artifical function is marked READONLY it ends up being optimized out anyway. Diff: --- gcc/rust/rust-gcc.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index c8eee0f4684..66fd8bce84e 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -1840,9 +1840,6 @@ Gcc_backend::call_expression (tree fn, const std::vector &fn_args, ret = build1_loc (location.gcc_location (), NOP_EXPR, rettype, ret); } - if (!TREE_SIDE_EFFECTS (ret)) - TREE_SIDE_EFFECTS (ret) = TREE_SIDE_EFFECTS (fndecl); - delete[] args; return ret; }