From 220a35cc8e39aa6e6a846fefee1a7bf460a339cc Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Thu, 17 Apr 2003 21:27:37 +0000 Subject: [PATCH] re PR c/10375 (Function-local external decls of builtins don't get attributes) 2003-04-17 Roger Sayle 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 | 6 ++++++ gcc/c-decl.c | 2 ++ gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl.c | 3 +++ gcc/f/ChangeLog | 6 ++++++ gcc/f/com.c | 2 ++ .../gcc.c-torture/execute/builtin-noret-2.x | 12 ------------ 7 files changed, 25 insertions(+), 12 deletions(-) delete mode 100644 gcc/testsuite/gcc.c-torture/execute/builtin-noret-2.x diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 660d0d669fa..7beb2fc52a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-04-17 Roger Sayle + + PR c/10375 + * c-decl.c (duplicate_decls): Preserve "const" and "noreturn" + function attributes. + 2003-04-17 Janis Johnson * doc/sourcebuild.texi (Test Suites): Document support for testing diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 0614476c00e..c852bd7789b 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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); } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 093198c567f..05545f13c66 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-04-17 Roger Sayle + + PR c/10375 + * decl.c (duplicate_decls): Preserve "const", "noreturn" and + "nothrow" function attributes. + 2003-04-17 Kriang Lerdsuwanakij PR c++/10347 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 33881d94f5f..5abb3f4c362 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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. */ diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 47240a4c654..2df580cd906 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,9 @@ +2003-04-17 Roger Sayle + + PR c/10375 + * com.c (duplicate_decls): Preserve "const" and "noreturn" + function attributes. + 2003-04-13 Roger Sayle * com.c (duplicate_decls): Preserve pure and malloc attributes. diff --git a/gcc/f/com.c b/gcc/f/com.c index 6c606444ac5..c92786bb120 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -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 index 7926a94f781..00000000000 --- a/gcc/testsuite/gcc.c-torture/execute/builtin-noret-2.x +++ /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