This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/71732] FAIL: gcc.dg/torture/pr71532.c at -O2 and above


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71732

--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> ---
--- gcc/cse.c.jj        2016-05-20 09:05:08.000000000 +0200
+++ gcc/cse.c   2016-06-15 16:01:21.568523552 +0200
@@ -5751,6 +5751,13 @@ cse_insn (rtx_insn *insn)
     {
       if (!(RTL_CONST_OR_PURE_CALL_P (insn)))
        invalidate_memory ();
+      else
+       /* For const/pure calls, invalidate any argument slots, because
+          those are owned by the callee.  */
+       for (tem = CALL_INSN_FUNCTION_USAGE (insn); tem; tem = XEXP (tem, 1))
+         if (GET_CODE (XEXP (tem, 0)) == USE
+             && MEM_P (XEXP (XEXP (tem, 0), 0)))
+           invalidate (XEXP (XEXP (tem, 0), 0), VOIDmode);
       invalidate_for_call ();
     }

I think a similar change is needed in cselib_process_insn.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]