Re: section anchors and weak hidden symbols

2013-05-17 Thread Nathan Sidwell
On 05/16/13 15:32, Rainer Orth wrote: The new gcc.dg/visibility-21.c testcase fails on i386-pc-solaris2.11 and x86_64-unknown-linux-gnu: FAIL: gcc.dg/visibility-21.c (test for excess errors) Excess errors: /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/visibility-21.c:1:0: warning: this

Re: section anchors and weak hidden symbols

2013-05-16 Thread Rainer Orth
Nathan Sidwell nat...@acm.org writes: This patch fixes a problem with section anchors. Found on powerpc, but also appears on MIPS and ARM targets. Section anchors can only be used for definitions known to bind in the current object file. The default predicate uses the bind_local_p hook to

Re: section anchors and weak hidden symbols

2013-05-14 Thread Nathan Sidwell
On 05/13/13 14:09, Jan Hubicka wrote: Index: varasm.c === I think DECL_COMDAT is not what you really want to return true for. So perhaps you really want (TREE_PUBLIC (decl) decl_binds_to_current_def_p)? Like this? This too

Re: section anchors and weak hidden symbols

2013-05-14 Thread Jan Hubicka
On 05/13/13 14:09, Jan Hubicka wrote: Index: varasm.c === I think DECL_COMDAT is not what you really want to return true for. So perhaps you really want (TREE_PUBLIC (decl) decl_binds_to_current_def_p)? Like this? This

Re: section anchors and weak hidden symbols

2013-05-13 Thread Nathan Sidwell
On 05/09/13 07:02, Nathan Sidwell wrote: On 05/08/13 18:47, Jan Hubicka wrote: Thinking about it again, isn't decl_replaceable_p the thing you are looking for here? that looks promising. I'll try !decl_replaceable_p in the section anchor hook. It does indeed seem to be the right

Re: section anchors and weak hidden symbols

2013-05-13 Thread Jan Hubicka
On 05/09/13 07:02, Nathan Sidwell wrote: On 05/08/13 18:47, Jan Hubicka wrote: Thinking about it again, isn't decl_replaceable_p the thing you are looking for here? that looks promising. I'll try !decl_replaceable_p in the section anchor hook. It does indeed seem to be the right

Re: section anchors and weak hidden symbols

2013-05-13 Thread Jan Hubicka
Index: varasm.c === --- varasm.c (revision 198771) +++ varasm.c (working copy) @@ -6582,10 +6582,18 @@ default_use_anchors_for_symbol_p (const_ { /* Don't use section anchors for decls that might be defined by

Re: section anchors and weak hidden symbols

2013-05-09 Thread Nathan Sidwell
On 05/08/13 18:47, Jan Hubicka wrote: On 05/08/13 14:11, Jan Hubicka wrote: * a new function or hook 'binds_here_p' (and any default implementations needed). Returns true if the symbol is known to bind in the object file being emitted by the current compilation. Thinking about it again,

section anchors and weak hidden symbols

2013-05-08 Thread Nathan Sidwell
This patch fixes a problem with section anchors. Found on powerpc, but also appears on MIPS and ARM targets. Section anchors can only be used for definitions known to bind in the current object file. The default predicate uses the bind_local_p hook to determine this. Unfortunately that

Re: section anchors and weak hidden symbols

2013-05-08 Thread Jan Hubicka
2013-05-08 Nathan Sidwell nat...@codesourcery.com gcc/ * varasm.c (default_use_anchors_for_symbol_p): Reject WEAK. gcc/testsuite/ * gcc.dg/visibility-21.c: New. Index: gcc/varasm.c === ---

Re: section anchors and weak hidden symbols

2013-05-08 Thread Nathan Sidwell
On 05/08/13 14:11, Jan Hubicka wrote: With LTO we play more of similar tricks, by making use of the resolution file. I.e. for COMMON and EXTERNAL. Does it matter here? probably. It'd be a missed optimization though, rather than wrong code emission. I would preffer the renaming

Re: section anchors and weak hidden symbols

2013-05-08 Thread Richard Sandiford
Thanks for fixing this. Nathan Sidwell nat...@acm.org writes: I would preffer the renaming excercise, since the name confused me few times, too and the other predicate would be useful for IPA code :) before invoking sed, can we agree on the right names? I propose * renaming 'binds_local_p'

Re: section anchors and weak hidden symbols

2013-05-08 Thread Jan Hubicka
On 05/08/13 14:11, Jan Hubicka wrote: With LTO we play more of similar tricks, by making use of the resolution file. I.e. for COMMON and EXTERNAL. Does it matter here? probably. It'd be a missed optimization though, rather than wrong code emission. Well, the resolution info turns

Re: section anchors and weak hidden symbols

2013-05-08 Thread Bernhard Reutner-Fischer
On 8 May 2013 15:11:18 Jan Hubicka hubi...@ucw.cz wrote: 2013-05-08 Nathan Sidwell nat...@codesourcery.com gcc/ * varasm.c (default_use_anchors_for_symbol_p): Reject WEAK. gcc/testsuite/ * gcc.dg/visibility-21.c: New. Index: gcc/varasm.c