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

--- Comment #1 from Hu Lin <lin1.hu at intel dot com> ---
Thank you.

We add gcc_assert (IN_RANGE (write, 0, 2)) in i386.md, but don't add exception
handling similar to that of __builtin_prefetch. 

@@ -14194,6 +14194,13 @@ ix86_expand_builtin (tree exp, rtx target, rtx
subtarget,
            return const0_rtx;
          }

+       if (!IN_RANGE (INTVAL (op1), 0, 2))
+         {
+           warning (0, "invalid second argument to
%<__builtin_ia32_prefetch%>;"
+                    " using zero");
+           op1 = const0_rtx;
+         }
+

The following changes have been made and are currently being tested。

Reply via email to