PATCH, spu: mark builtins as nothrow

Ben Elliston bje@au1.ibm.com
Sat Apr 5 06:32:00 GMT 2008


This patch is a follow-on from a target independent patch I just
committed to optimise the call graph for builtins that return exactly
once.  In order to make that work for SPU builtins, we need to be more
descriptive about the builtin functions by marking them nothrow.  The
patch also makes a few trivial stylistic changes.  Tested with a full
regression test run on spu-unknown-elf.

Are there any SPU builtins that could trigger an exception that I have
overlooked?  Otherwise, okay for mainline?

Thanks, Ben


2008-04-05  Ben Elliston  <bje@au.ibm.com>

        * config/spu/spu.c (spu_init_builtins): Mark builtins as nothrow.

Index: config/spu/spu.c
===================================================================
--- config/spu/spu.c    (revision 133929)
+++ config/spu/spu.c    (working copy)
@@ -4518,10 +4518,9 @@ spu_init_builtins (void)
       if (d->name == 0)
        continue;
 
-      /* find last parm */
+      /* Find last parm.  */
       for (parm = 1; d->parm[parm] != SPU_BTI_END_OF_PARAMS; parm++)
-       {
-       }
+       ;
 
       p = void_list_node;
       while (parm > 1)
@@ -4535,6 +4534,9 @@ spu_init_builtins (void)
                              NULL, NULL_TREE);
       if (d->fcode == SPU_MASK_FOR_LOAD)
        TREE_READONLY (d->fndecl) = 1;
+
+      /* These builtins don't throw.  */
+      TREE_NOTHROW (d->fndecl) = 1;
     }
 }
 




More information about the Gcc-patches mailing list