* expr.c (init_block_move_fn): Force default visibility.
(init_block_clear_fn): Likewise.
* builtins.c (expand_builtin_fork_or_exec): Likewise.
* targhooks.c (default_external_stack_protect_fail): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112270
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-03-21 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/20297
+ * expr.c (init_block_move_fn): Force default visibility.
+ (init_block_clear_fn): Likewise.
+ * builtins.c (expand_builtin_fork_or_exec): Likewise.
+ * targhooks.c (default_external_stack_protect_fail): Likewise.
+
2006-03-21 Richard Sandiford <richard@codesourcery.com>
* config/mips/predicates.md (const_call_insn_operand): Allow direct
TREE_PUBLIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
TREE_NOTHROW (decl) = 1;
+ DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (fn) = 1;
call = build_function_call_expr (decl, arglist);
return expand_call (call, target, ignore);
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
TREE_NOTHROW (fn) = 1;
+ DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (fn) = 1;
block_move_fn = fn;
}
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
TREE_NOTHROW (fn) = 1;
+ DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (fn) = 1;
block_clear_fn = fn;
}
TREE_NOTHROW (t) = 1;
DECL_ARTIFICIAL (t) = 1;
DECL_IGNORED_P (t) = 1;
+ DECL_VISIBILITY (t) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (t) = 1;
stack_chk_fail_decl = t;
}
--- /dev/null
+/* PR middle-end/20297 */
+/* The memcpy FUNCTION_DECL built in the middle-end for block moves got
+ hidden visibility from the first push, so the call didn't use the PLT. */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-visibility "" } */
+/* { dg-options "-Os -fpic" } */
+/* { dg-final { scan-assembler "memcpy@PLT" } } */
+
+#pragma GCC visibility push(hidden)
+#pragma GCC visibility push(default)
+extern void* memcpy (void *, const void *, __SIZE_TYPE__);
+#pragma GCC visibility pop
+
+struct a { int a[10]; };
+
+extern void *bar (struct a *, struct a *, int);
+
+void *
+foo (struct a *a, struct a *b, int c)
+{
+ struct a cc = *b;
+ return bar (a, &cc, 4 * c);
+}