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]

Re: [PATCH] Add additional __builtin_unreachable() test.


Paolo Bonzini wrote:
David Daney wrote:
Paolo requested this additional test for the new __builtin_unreachable() built-in.

Go ahead after changing this:


/* { dg-options "-O2 -m32 -fomit-frame-pointer" } */

to:

/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -fomit-frame-pointer" } */


For the record, this is what I committed:


2009-06-17 David Daney <ddaney@caviumnetworks.com>

* gcc.target/i386/builtin-unreachable.c: New test.

Index: gcc.target/i386/builtin-unreachable.c
===================================================================
--- gcc.target/i386/builtin-unreachable.c	(revision 0)
+++ gcc.target/i386/builtin-unreachable.c	(revision 148622)
@@ -0,0 +1,13 @@
+/* This should return 1 without setting up a stack frame or
+   jumping.  */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+int h (char *p)
+{
+  if (*p)
+    __builtin_unreachable ();
+  return p ? 1 : 0;
+}
+/* { dg-final { scan-assembler-not "%e\[bs\]p" } } */
+/* { dg-final { scan-assembler-not "\[\\t \]+j" } } */


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