From: John David Anglin Date: Mon, 25 Jul 2016 17:32:44 +0000 (+0000) Subject: re PR middle-end/71732 (FAIL: gcc.dg/torture/pr71532.c at -O2 and above) X-Git-Tag: upstream/12.2.0~45665 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=007b405bbfa20787eb15a110ce250989d0467622;p=platform%2Fupstream%2Fgcc.git re PR middle-end/71732 (FAIL: gcc.dg/torture/pr71532.c at -O2 and above) PR middle-end/71732 * cselib.c (cselib_process_insn): Invalidate argument slots for const/pure calls. From-SVN: r238727 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 303e4f5..97a9ab0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-07-25 John David Anglin + + PR middle-end/71732 + * cselib.c (cselib_process_insn): Invalidate argument slots for + const/pure calls. + 2016-07-25 Jiong Wang * config/aarch64/arm_neon.h (vfmah_lane_f16, vfmah_laneq_f16, diff --git a/gcc/cselib.c b/gcc/cselib.c index 14c7b32..0c5183c 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -2659,6 +2659,13 @@ cselib_process_insn (rtx_insn *insn) if (RTL_LOOPING_CONST_OR_PURE_CALL_P (insn) || !(RTL_CONST_OR_PURE_CALL_P (insn))) cselib_invalidate_mem (callmem); + else + /* For const/pure calls, invalidate any argument slots because + they are owned by the callee. */ + for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1)) + if (GET_CODE (XEXP (x, 0)) == USE + && MEM_P (XEXP (XEXP (x, 0), 0))) + cselib_invalidate_mem (XEXP (XEXP (x, 0), 0)); } cselib_record_sets (insn);