re PR c/10375 (Function-local external decls of builtins don't get attributes)
authorRoger Sayle <roger@eyesopen.com>
Thu, 17 Apr 2003 21:27:37 +0000 (21:27 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 17 Apr 2003 21:27:37 +0000 (21:27 +0000)
2003-04-17  Roger Sayle  <roger@eyesopen.com>

PR c/10375
* c-decl.c (duplicate_decls): Preserve "const" and "noreturn"
function attributes.

* cp/decl.c (duplicate_decls): Preserve "const", "noreturn"
and "nothrow" function attributes.

* f/com.c (duplicate_decls): Preserve "const" and "noreturn"
function attributes.

From-SVN: r65753

gcc/ChangeLog
gcc/c-decl.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/testsuite/gcc.c-torture/execute/builtin-noret-2.x [deleted file]

index 660d0d669fa080df5fe8f0473fab610e524779c9..7beb2fc52a26db7c030c11842ae97989aecfa33a 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-17  Roger Sayle  <roger@eyesopen.com>
+
+       PR c/10375
+       * c-decl.c (duplicate_decls): Preserve "const" and "noreturn"
+       function attributes.
+
 2003-04-17  Janis Johnson  <janis187@us.ibm.com>
 
        * doc/sourcebuild.texi (Test Suites): Document support for testing
index 0614476c00e2816b7fe3ea4de5e656d72fd8afad..c852bd7789b1990922da25c6f054afb8bb72da2e 100644 (file)
@@ -1377,6 +1377,8 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
          DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl);
          DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
            |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
+         TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl);
+         TREE_READONLY (newdecl) |= TREE_READONLY (olddecl);
          DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl);
          DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl);
        }
index 093198c567f9dbb441d0b682abd4f5f70621e1b8..05545f13c66d2264c084706edb22e2e0392d6f25 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-17  Roger Sayle  <roger@eyesopen.com>
+
+       PR c/10375
+       * decl.c (duplicate_decls): Preserve "const", "noreturn" and
+       "nothrow" function attributes.
+
 2003-04-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/10347
index 33881d94f5fa7c253df83e34680b2addb2a3813f..5abb3f4c36253b62eaeb81638b862cecc31b1778 100644 (file)
@@ -3360,6 +3360,9 @@ duplicate_decls (tree newdecl, tree olddecl)
          DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
            |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
          DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl);
+         TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl);
+         TREE_READONLY (newdecl) |= TREE_READONLY (olddecl);
+         TREE_NOTHROW (newdecl) |= TREE_NOTHROW (olddecl);
          DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl);
          DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl);
          /* Keep the old RTL.  */
index 47240a4c654f884690ada5cb3d79656e70681795..2df580cd906eeafb0f6c528679c33e4e4ca6f19b 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-17  Roger Sayle  <roger@eyesopen.com>
+
+       PR c/10375
+       * com.c (duplicate_decls): Preserve "const" and "noreturn"
+       function attributes.
+
 2003-04-13  Roger Sayle  <roger@eyesopen.com>
 
        * com.c (duplicate_decls): Preserve pure and malloc attributes.
index 6c606444ac50b7d0d7225dfef145bd56fa7e3628..c92786bb120a11a2d6355b1bcc335052c354d491 100644 (file)
@@ -13335,6 +13335,8 @@ duplicate_decls (tree newdecl, tree olddecl)
        {
          DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl);
          DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
+         TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl);
+         TREE_READONLY (newdecl) |= TREE_READONLY (olddecl);
          DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl);
          DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl);
        }
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtin-noret-2.x b/gcc/testsuite/gcc.c-torture/execute/builtin-noret-2.x
deleted file mode 100644 (file)
index 7926a94..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# This test fails at -O1 and higher.
-set torture_eval_before_compile {
-    global compiler_conditional_xfail_data
-    set compiler_conditional_xfail_data {
-        "Fails at all optimization levels but -O0, see PR10375." \
-        { "*-*-*" } \
-        { "-O*" } \
-        { "-O0" }
-    }
-}
-
-return 0