From 8905c4331d854333a953eebceef229266c3943e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Mon, 23 May 2005 10:30:55 +0000 Subject: [PATCH] - fix handling #pragma gcc visibility for builtins. Changed files: gcc-pr20297.patch -> 1.1 gcc.spec -> 1.308 --- gcc-pr20297.patch | 54 +++++++++++++++++++++++++++++++++++++++++++++++ gcc.spec | 4 +++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 gcc-pr20297.patch diff --git a/gcc-pr20297.patch b/gcc-pr20297.patch new file mode 100644 index 0000000..687e824 --- /dev/null +++ b/gcc-pr20297.patch @@ -0,0 +1,54 @@ +Date: Thu, 3 Mar 2005 11:08:30 -0800 +From: "H dot J dot Lu" +Subject: PATCH: PR middle-end/20297: #pragma GCC visibility isn't properly handled for builtin functions + +2005-03-03 H.J. Lu + + PR middle-end/20297 + * builtins.c (expand_builtin_1): Renamed from expand_builtin. + (expand_builtin): Save/restore default_visibility and + visibility_options.inpragma when calling expand_builtin_1. + +--- gcc-4.0-20050521/gcc/builtins.c.orig 2005-05-04 09:35:06.000000000 +0200 ++++ gcc-4.0-20050521/gcc/builtins.c 2005-05-23 12:19:53.000000000 +0200 +@@ -5119,9 +5119,9 @@ expand_builtin_fork_or_exec (tree fn, tr + SUBTARGET may be used as the target for computing one of EXP's operands. + IGNORE is nonzero if the value is to be ignored. */ + +-rtx +-expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, +- int ignore) ++static rtx ++expand_builtin_1 (tree exp, rtx target, rtx subtarget, ++ enum machine_mode mode, int ignore) + { + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); +@@ -5755,6 +5755,27 @@ expand_builtin (tree exp, rtx target, rt + return expand_call (exp, target, ignore); + } + ++rtx ++expand_builtin (tree exp, rtx target, rtx subtarget, ++ enum machine_mode mode, int ignore) ++{ ++ enum symbol_visibility saved_visibility = default_visibility; ++ unsigned int saved_inpragma = visibility_options.inpragma; ++ rtx expanded; ++ ++ /* We should use the original visibility of the builtin function ++ declaration. */ ++ default_visibility = DECL_VISIBILITY (exp); ++ visibility_options.inpragma = DECL_VISIBILITY_SPECIFIED (exp); ++ ++ expanded = expand_builtin_1 (exp, target, subtarget, mode, ignore); ++ ++ default_visibility = saved_visibility; ++ visibility_options.inpragma = saved_inpragma; ++ ++ return expanded; ++} ++ + /* Determine whether a tree node represents a call to a built-in + function. If the tree T is a call to a built-in function with + the right number of arguments of the appropriate types, return diff --git a/gcc.spec b/gcc.spec index 127006b..555b890 100644 --- a/gcc.spec +++ b/gcc.spec @@ -25,7 +25,7 @@ Summary(pt_BR): Cole Name: gcc Version: 4.0.1 %define _snap 20050521 -Release: 0.%{_snap}.1 +Release: 0.%{_snap}.2 Epoch: 5 License: GPL v2+ Group: Development/Languages @@ -42,6 +42,7 @@ Patch5: %{name}-alpha-ada_fix.patch # PRs Patch10: %{name}-pr19664.patch Patch11: %{name}-pr20218.patch +Patch12: %{name}-pr20297.patch Patch14: %{name}-push-pop-visibility.patch Patch15: %{name}-pr21704.patch URL: http://gcc.gnu.org/ @@ -687,6 +688,7 @@ Statyczne biblioteki Obiektowego C. # PRs %patch10 -p1 %patch11 -p0 +%patch12 -p1 %patch14 -p0 %patch15 -p1 -- 2.44.0