This is the mail archive of the gcc-patches@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]

[PATCH] Fix PR80880


Approved by Ilya in the PR.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2017-05-31  Richard Biener  <rguenther@suse.de>

	PR target/80880
	* config/i386/i386.c (ix86_expand_builtin): Remove assert
	for arg being an SSA name when expanding IX86_BUILTIN_BNDRET.

	* gcc.target/i386/pr80880.c: New testcase.

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 248722)
+++ gcc/config/i386/i386.c	(working copy)
@@ -37584,7 +37584,6 @@ ix86_expand_builtin (tree exp, rtx targe
 
     case IX86_BUILTIN_BNDRET:
       arg0 = CALL_EXPR_ARG (exp, 0);
-      gcc_assert (TREE_CODE (arg0) == SSA_NAME);
       target = chkp_get_rtl_bounds (arg0);
 
       /* If no bounds were specified for returned value,
Index: gcc/testsuite/gcc.target/i386/pr80880.c
===================================================================
--- gcc/testsuite/gcc.target/i386/pr80880.c	(revision 0)
+++ gcc/testsuite/gcc.target/i386/pr80880.c	(working copy)
@@ -0,0 +1,10 @@
+/* PR target/65523 */
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-O -fcheck-pointer-bounds -mmpx" } */
+
+int *fn1()
+{
+  int *r = fn1();
+  if (r == (void *)0)
+    return r;
+}


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