This is the mail archive of the
gcc-regression@gcc.gnu.org
mailing list for the GCC project.
Re: GCC build failed for native with your patch on 2003-09-05T11:02:39Z.
> Jan Hubicka <jh@suse.cz> writes:
>
> > >
> > > On Saturday, Sep 6, 2003, at 12:01 US/Pacific, Jan Hubicka wrote:
> > > >In the case you have a testcase I can try to look into it.
> > > >(After all I had to deal with a tons of similar issues)
> > >
> > > Here is the reduced testcase (I think this is a Darwin specific bug
> > > meaning
> > > the Darwin's backend does not expect the variable to change to being a
> > > common symbol from a non-common, I will be looking into this, Darwin's
> > > backend
> > > might just have to be rewritten, I already rewrote the PIC code part
> > > The right asm does not have ".comm __ZN5ctypeIcE2idE,1" but
> > > .globl __ZN5ctypeIcE2idE
> > > .data
> > > __ZN5ctypeIcE2idE:
> > > .space 1
> > > So it looks like unit-at-a-time is marking _ZN5ctypeIcE2idE
> > > (ctype<char>::id)
> > > as a common symbol but it did it after Darwin's backend saw it as a
> > > non-common.
> >
> > This sounds really interesting. With unit-at-a-time we should not tell
> > backend anything before finalizing all the flags. Hmm...
>
> The problem is that encode_section_info is being called from
> cp_finish_decl, but then later on comdat_linkage is called from many
> places including import_export_decl. This breaks Darwin's current
> ugly way of doing PIC, but even if Darwin used all the new features
> like SYMBOL_REF_LOCAL_P it wouldn't help because they are wrong too
> (because default_binds_local_p_1 also looks at DECL_COMMON).
I am attaching patch I am just about to test (it may require adding code
to deal with functions in cp/decl2.c bits), but it fixes testcase sent
by Andrew.
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.26
diff -c -3 -p -r1.26 cgraph.c
*** cgraph.c 5 Sep 2003 04:24:26 -0000 1.26
--- cgraph.c 6 Sep 2003 22:21:01 -0000
*************** cgraph_remove_node (struct cgraph_node *
*** 239,251 ****
void
cgraph_mark_reachable_node (struct cgraph_node *node)
{
! if (!node->reachable && DECL_SAVED_TREE (node->decl))
{
node->reachable = 1;
node->next_needed = cgraph_nodes_queue;
cgraph_nodes_queue = node;
- notice_global_symbol (node->decl);
/* At the moment frontend automatically emits all nested functions. */
if (node->nested)
--- 239,251 ----
void
cgraph_mark_reachable_node (struct cgraph_node *node)
{
! if (!node->reachable && node->local.finalized)
{
+ notice_global_symbol (node->decl);
node->reachable = 1;
node->next_needed = cgraph_nodes_queue;
cgraph_nodes_queue = node;
/* At the moment frontend automatically emits all nested functions. */
if (node->nested)
*************** cgraph_varpool_finalize_decl (tree decl)
*** 486,491 ****
--- 486,492 ----
{
node->next_needed = cgraph_varpool_nodes_queue;
cgraph_varpool_nodes_queue = node;
+ notice_global_symbol (decl);
}
node->finalized = true;
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.667
diff -c -3 -p -r1.667 decl2.c
*** cp/decl2.c 5 Sep 2003 08:24:19 -0000 1.667
--- cp/decl2.c 6 Sep 2003 22:21:03 -0000
*************** finish_file ()
*** 2875,2881 ****
for (i = 0; i < pending_statics_used; ++i)
{
tree decl = VARRAY_TREE (pending_statics, i);
! if (TREE_ASM_WRITTEN (decl))
continue;
import_export_decl (decl);
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))
--- 2875,2882 ----
for (i = 0; i < pending_statics_used; ++i)
{
tree decl = VARRAY_TREE (pending_statics, i);
! if (TREE_ASM_WRITTEN (decl)
! || (flag_unit_at_a_time && cgraph_varpool_node (decl)->finalized))
continue;
import_export_decl (decl);
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))
>
> --
> - Geoffrey Keating <geoffk@geoffk.org>