]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc-interface/trans.c (gigi): Decorate reraise_zcx_decl.
authorTristan Gingold <gingold@adacore.com>
Sun, 6 May 2012 11:28:20 +0000 (11:28 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 6 May 2012 11:28:20 +0000 (11:28 +0000)
From-SVN: r187210

gcc/ada/ChangeLog
gcc/ada/gcc-interface/trans.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/warn7.adb [new file with mode: 0644]

index 856d100e8b0bf9794a12097924063ddba5a580e9..fa564b14f45a2f6799d38d6f1cb24326aed7b0a6 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-06  Tristan Gingold  <gingold@adacore.com>
+
+       * gcc-interface/trans.c (gigi): Decorate reraise_zcx_decl.
+
 2012-05-06  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: In the renaming
index c4b9a7e2e319e4f6a505ea0fe1ac2e6f928b1125..dd1669b7977e9795b61d0c537ea49cb9f1151aba 100644 (file)
@@ -502,7 +502,12 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
     = create_subprog_decl (get_identifier ("__gnat_reraise_zcx"), NULL_TREE,
                           ftype, NULL_TREE, false, true, true, true, NULL,
                           Empty);
+  /* Indicate that these never return.  */
   DECL_IGNORED_P (reraise_zcx_decl) = 1;
+  TREE_THIS_VOLATILE (reraise_zcx_decl) = 1;
+  TREE_SIDE_EFFECTS (reraise_zcx_decl) = 1;
+  TREE_TYPE (reraise_zcx_decl)
+    = build_qualified_type (TREE_TYPE (reraise_zcx_decl), TYPE_QUAL_VOLATILE);
 
   /* If in no exception handlers mode, all raise statements are redirected to
      __gnat_last_chance_handler.  No need to redefine raise_nodefer_decl since
@@ -550,6 +555,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
        build_function_type_list (build_pointer_type (except_type_node),
                                 NULL_TREE),
      NULL_TREE, false, true, true, true, NULL, Empty);
+  DECL_IGNORED_P (get_excptr_decl) = 1;
 
   raise_nodefer_decl
     = create_subprog_decl
index 20133aa4cbd472fee2204fc0ae38e1dea4113e54..d777ff447b311e7eea96d4ea7ba9d9425ac8b97b 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-06  Tristan Gingold  <gingold@adacore.com>
+
+       * gnat.dg/warn7.adb: New test.
+
 2012-05-06  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/specs/renamings.ads: Rename to...
diff --git a/gcc/testsuite/gnat.dg/warn7.adb b/gcc/testsuite/gnat.dg/warn7.adb
new file mode 100644 (file)
index 0000000..93c14f4
--- /dev/null
@@ -0,0 +1,18 @@
+-- { dg-do compile }
+
+procedure Warn7 is
+
+   procedure Nested;
+   pragma No_Return (Nested);
+
+   procedure Nested is
+   begin
+      raise Constraint_Error;
+   exception
+      when Constraint_Error =>
+         raise;
+   end;
+
+begin
+   Nested;
+end;