]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans-decl.c (gfc_build_intrinsic_function_decls): Set TREE_NOTHROW on fndecls that...
authorJakub Jelinek <jakub@redhat.com>
Wed, 25 Aug 2010 14:44:46 +0000 (16:44 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 25 Aug 2010 14:44:46 +0000 (16:44 +0200)
* trans-decl.c (gfc_build_intrinsic_function_decls): Set
TREE_NOTHROW on fndecls that can't throw.  Set
TREE_READONLY on gfor_fndecl_math_ishftc{4,8,16}.
(gfc_build_builtin_function_decls): Set TREE_NOTHROW on
gfor_fndecl_associated.

From-SVN: r163548

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c

index 831c7796d8254a72dbf569377426faddb9bfe1e9..58eaf1556167b0d30231acbe6b5da3d854edff99 100644 (file)
@@ -1,3 +1,11 @@
+2010-08-25  Jakub Jelinek  <jakub@redhat.com>
+
+       * trans-decl.c (gfc_build_intrinsic_function_decls): Set
+       TREE_NOTHROW on fndecls that can't throw.  Set
+       TREE_READONLY on gfor_fndecl_math_ishftc{4,8,16}.
+       (gfc_build_builtin_function_decls): Set TREE_NOTHROW on
+       gfor_fndecl_associated.
+
 2010-08-23  Mikael Morin  <mikael@gcc.gnu.org>
 
        PR fortran/45380
index 3904b0d7ddb2367a766569b77bc14b9dc3ba941e..5a73b4cd97e7b10ba8f11bc9f15514adbfd50481 100644 (file)
@@ -2444,35 +2444,41 @@ gfc_build_intrinsic_function_decls (void)
        integer_type_node, 4, gfc_charlen_type_node, pchar1_type_node,
        gfc_charlen_type_node, pchar1_type_node);
   DECL_PURE_P (gfor_fndecl_compare_string) = 1;
+  TREE_NOTHROW (gfor_fndecl_compare_string) = 1;
 
   gfor_fndecl_concat_string = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("concat_string")), "..W.R.R",
        void_type_node, 6, gfc_charlen_type_node, pchar1_type_node,
        gfc_charlen_type_node, pchar1_type_node,
        gfc_charlen_type_node, pchar1_type_node);
+  TREE_NOTHROW (gfor_fndecl_concat_string) = 1;
 
   gfor_fndecl_string_len_trim = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_len_trim")), "..R",
        gfc_charlen_type_node, 2, gfc_charlen_type_node, pchar1_type_node);
   DECL_PURE_P (gfor_fndecl_string_len_trim) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_len_trim) = 1;
 
   gfor_fndecl_string_index = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_index")), "..R.R.",
        gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar1_type_node,
        gfc_charlen_type_node, pchar1_type_node, gfc_logical4_type_node);
   DECL_PURE_P (gfor_fndecl_string_index) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_index) = 1;
 
   gfor_fndecl_string_scan = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_scan")), "..R.R.",
        gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar1_type_node,
        gfc_charlen_type_node, pchar1_type_node, gfc_logical4_type_node);
   DECL_PURE_P (gfor_fndecl_string_scan) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_scan) = 1;
 
   gfor_fndecl_string_verify = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_verify")), "..R.R.",
        gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar1_type_node,
        gfc_charlen_type_node, pchar1_type_node, gfc_logical4_type_node);
   DECL_PURE_P (gfor_fndecl_string_verify) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_verify) = 1;
 
   gfor_fndecl_string_trim = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_trim")), ".Ww.R",
@@ -2490,52 +2496,61 @@ gfc_build_intrinsic_function_decls (void)
        get_identifier (PREFIX("adjustl")), ".W.R",
        void_type_node, 3, pchar1_type_node, gfc_charlen_type_node,
        pchar1_type_node);
+  TREE_NOTHROW (gfor_fndecl_adjustl) = 1;
 
   gfor_fndecl_adjustr = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("adjustr")), ".W.R",
        void_type_node, 3, pchar1_type_node, gfc_charlen_type_node,
        pchar1_type_node);
+  TREE_NOTHROW (gfor_fndecl_adjustr) = 1;
 
   gfor_fndecl_select_string =  gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("select_string")), ".R.R.",
        integer_type_node, 4, pvoid_type_node, integer_type_node,
        pchar1_type_node, gfc_charlen_type_node);
   DECL_PURE_P (gfor_fndecl_select_string) = 1;
+  TREE_NOTHROW (gfor_fndecl_select_string) = 1;
 
   gfor_fndecl_compare_string_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("compare_string_char4")), "..R.R",
        integer_type_node, 4, gfc_charlen_type_node, pchar4_type_node,
        gfc_charlen_type_node, pchar4_type_node);
   DECL_PURE_P (gfor_fndecl_compare_string_char4) = 1;
+  TREE_NOTHROW (gfor_fndecl_compare_string_char4) = 1;
 
   gfor_fndecl_concat_string_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("concat_string_char4")), "..W.R.R",
        void_type_node, 6, gfc_charlen_type_node, pchar4_type_node,
        gfc_charlen_type_node, pchar4_type_node, gfc_charlen_type_node,
        pchar4_type_node);
+  TREE_NOTHROW (gfor_fndecl_concat_string_char4) = 1;
 
   gfor_fndecl_string_len_trim_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_len_trim_char4")), "..R",
        gfc_charlen_type_node, 2, gfc_charlen_type_node, pchar4_type_node);
   DECL_PURE_P (gfor_fndecl_string_len_trim_char4) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_len_trim_char4) = 1;
 
   gfor_fndecl_string_index_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_index_char4")), "..R.R.",
        gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar4_type_node,
        gfc_charlen_type_node, pchar4_type_node, gfc_logical4_type_node);
   DECL_PURE_P (gfor_fndecl_string_index_char4) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_index_char4) = 1;
 
   gfor_fndecl_string_scan_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_scan_char4")), "..R.R.",
        gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar4_type_node,
        gfc_charlen_type_node, pchar4_type_node, gfc_logical4_type_node);
   DECL_PURE_P (gfor_fndecl_string_scan_char4) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_scan_char4) = 1;
 
   gfor_fndecl_string_verify_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_verify_char4")), "..R.R.",
        gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar4_type_node,
        gfc_charlen_type_node, pchar4_type_node, gfc_logical4_type_node);
   DECL_PURE_P (gfor_fndecl_string_verify_char4) = 1;
+  TREE_NOTHROW (gfor_fndecl_string_verify_char4) = 1;
 
   gfor_fndecl_string_trim_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("string_trim_char4")), ".Ww.R",
@@ -2553,17 +2568,20 @@ gfc_build_intrinsic_function_decls (void)
        get_identifier (PREFIX("adjustl_char4")), ".W.R",
        void_type_node, 3, pchar4_type_node, gfc_charlen_type_node,
        pchar4_type_node);
+  TREE_NOTHROW (gfor_fndecl_adjustl_char4) = 1;
 
   gfor_fndecl_adjustr_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("adjustr_char4")), ".W.R",
        void_type_node, 3, pchar4_type_node, gfc_charlen_type_node,
        pchar4_type_node);
+  TREE_NOTHROW (gfor_fndecl_adjustr_char4) = 1;
 
   gfor_fndecl_select_string_char4 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("select_string_char4")), ".R.R.",
        integer_type_node, 4, pvoid_type_node, integer_type_node,
        pvoid_type_node, gfc_charlen_type_node);
   DECL_PURE_P (gfor_fndecl_select_string_char4) = 1;
+  TREE_NOTHROW (gfor_fndecl_select_string_char4) = 1;
 
 
   /* Conversion between character kinds.  */
@@ -2598,17 +2616,20 @@ gfc_build_intrinsic_function_decls (void)
        get_identifier (PREFIX("selected_char_kind")), "..R",
        gfc_int4_type_node, 2, gfc_charlen_type_node, pchar_type_node);
   DECL_PURE_P (gfor_fndecl_sc_kind) = 1;
+  TREE_NOTHROW (gfor_fndecl_sc_kind) = 1;
 
   gfor_fndecl_si_kind = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("selected_int_kind")), ".R",
        gfc_int4_type_node, 1, pvoid_type_node);
   DECL_PURE_P (gfor_fndecl_si_kind) = 1;
+  TREE_NOTHROW (gfor_fndecl_si_kind) = 1;
 
   gfor_fndecl_sr_kind = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("selected_real_kind2008")), ".RR",
        gfc_int4_type_node, 3, pvoid_type_node, pvoid_type_node,
        pvoid_type_node);
   DECL_PURE_P (gfor_fndecl_sr_kind) = 1;
+  TREE_NOTHROW (gfor_fndecl_sr_kind) = 1;
 
   /* Power functions.  */
   {
@@ -2635,6 +2656,7 @@ gfc_build_intrinsic_function_decls (void)
                  gfc_build_library_function_decl (get_identifier (name),
                    jtype, 2, jtype, itype);
                TREE_READONLY (gfor_fndecl_math_powi[jkind][ikind].integer) = 1;
+               TREE_NOTHROW (gfor_fndecl_math_powi[jkind][ikind].integer) = 1;
              }
          }
 
@@ -2649,6 +2671,7 @@ gfc_build_intrinsic_function_decls (void)
                  gfc_build_library_function_decl (get_identifier (name),
                    rtype, 2, rtype, itype);
                TREE_READONLY (gfor_fndecl_math_powi[rkind][ikind].real) = 1;
+               TREE_NOTHROW (gfor_fndecl_math_powi[rkind][ikind].real) = 1;
              }
 
            ctype = gfc_get_complex_type (rkinds[rkind]);
@@ -2660,6 +2683,7 @@ gfc_build_intrinsic_function_decls (void)
                  gfc_build_library_function_decl (get_identifier (name),
                    ctype, 2,ctype, itype);
                TREE_READONLY (gfor_fndecl_math_powi[rkind][ikind].cmplx) = 1;
+               TREE_NOTHROW (gfor_fndecl_math_powi[rkind][ikind].cmplx) = 1;
              }
          }
       }
@@ -2671,17 +2695,25 @@ gfc_build_intrinsic_function_decls (void)
        get_identifier (PREFIX("ishftc4")),
        gfc_int4_type_node, 3, gfc_int4_type_node, gfc_int4_type_node,
        gfc_int4_type_node);
+  TREE_READONLY (gfor_fndecl_math_ishftc4) = 1;
+  TREE_NOTHROW (gfor_fndecl_math_ishftc4) = 1;
        
   gfor_fndecl_math_ishftc8 = gfc_build_library_function_decl (
        get_identifier (PREFIX("ishftc8")),
        gfc_int8_type_node, 3, gfc_int8_type_node, gfc_int4_type_node,
        gfc_int4_type_node);
+  TREE_READONLY (gfor_fndecl_math_ishftc8) = 1;
+  TREE_NOTHROW (gfor_fndecl_math_ishftc8) = 1;
 
   if (gfc_int16_type_node)
-    gfor_fndecl_math_ishftc16 = gfc_build_library_function_decl (
+    {
+      gfor_fndecl_math_ishftc16 = gfc_build_library_function_decl (
        get_identifier (PREFIX("ishftc16")),
        gfc_int16_type_node, 3, gfc_int16_type_node, gfc_int4_type_node,
        gfc_int4_type_node);
+      TREE_READONLY (gfor_fndecl_math_ishftc16) = 1;
+      TREE_NOTHROW (gfor_fndecl_math_ishftc16) = 1;
+    }
 
   /* BLAS functions.  */
   {
@@ -2731,14 +2763,17 @@ gfc_build_intrinsic_function_decls (void)
        get_identifier (PREFIX("size0")), ".R",
        gfc_array_index_type, 1, pvoid_type_node);
   DECL_PURE_P (gfor_fndecl_size0) = 1;
+  TREE_NOTHROW (gfor_fndecl_size0) = 1;
 
   gfor_fndecl_size1 = gfc_build_library_function_decl_with_spec (
        get_identifier (PREFIX("size1")), ".R",
        gfc_array_index_type, 2, pvoid_type_node, gfc_array_index_type);
   DECL_PURE_P (gfor_fndecl_size1) = 1;
+  TREE_NOTHROW (gfor_fndecl_size1) = 1;
 
   gfor_fndecl_iargc = gfc_build_library_function_decl (
        get_identifier (PREFIX ("iargc")), gfc_int4_type_node, 0);
+  TREE_NOTHROW (gfor_fndecl_iargc) = 1;
 
   if (gfc_type_for_size (128, true))
     {
@@ -2747,10 +2782,12 @@ gfc_build_intrinsic_function_decls (void)
       gfor_fndecl_clz128 = gfc_build_library_function_decl (
        get_identifier (PREFIX ("clz128")), integer_type_node, 1, uint128);
       TREE_READONLY (gfor_fndecl_clz128) = 1;
+      TREE_NOTHROW (gfor_fndecl_clz128) = 1;
 
       gfor_fndecl_ctz128 = gfc_build_library_function_decl (
        get_identifier (PREFIX ("ctz128")), integer_type_node, 1, uint128);
       TREE_READONLY (gfor_fndecl_ctz128) = 1;
+      TREE_NOTHROW (gfor_fndecl_ctz128) = 1;
     }
 }
 
@@ -2860,6 +2897,7 @@ gfc_build_builtin_function_decls (void)
        get_identifier (PREFIX("associated")), ".RR",
        integer_type_node, 2, ppvoid_type_node, ppvoid_type_node);
   DECL_PURE_P (gfor_fndecl_associated) = 1;
+  TREE_NOTHROW (gfor_fndecl_associated) = 1;
 
   gfc_build_intrinsic_function_decls ();
   gfc_build_intrinsic_lib_fndecls ();