Bug 38237 - [4.4/4.5 regression] multiple weak directives
Summary: [4.4/4.5 regression] multiple weak directives
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P5 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-23 14:03 UTC by Eric Botcazou
Modified: 2009-03-30 16:46 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail: 4.4.0
Last reconfirmed: 2008-11-23 16:14:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2008-11-23 14:03:11 UTC
This is a fallout of

2008-08-19  Rafael Espíndola  <espindola@google.com>

	* varasm.c (weak_decls): Move earlier in the file.
	(assemble_external): Add weak decls to the weak_decls list.
	(declare_weak): Don't add decls to the weak_decls list.


eric@atlantis:~/build/gcc/native32> cat t.c
extern int i __attribute__((weak));

void foo(void)
{
  int a = i + i + i + i;
}
eric@atlantis:~/build/gcc/native32> cat t.s
        .file   "t.c"
        .text
.globl foo
        .type   foo, @function
foo:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $16, %esp
        movl    i, %edx
        movl    i, %eax
        addl    %eax, %edx
        movl    i, %eax
        addl    %eax, %edx
        movl    i, %eax
        leal    (%edx,%eax), %eax
        movl    %eax, -4(%ebp)
        leave
        ret
        .size   foo, .-foo
        .weak   i
        .weak   i
        .weak   i
        .weak   i
        .ident  "GCC: (GNU) 4.4.0 20081122 (experimental) [trunk revision 142117]"
        .section        .note.GNU-stack,"",@progbits
Comment 1 Richard Biener 2008-11-23 16:14:38 UTC
Confirmed.
Comment 2 Joseph S. Myers 2008-11-27 17:36:57 UTC
Setting to P5, please restore to P3 if the assembler for some primary or secondary target complains about the multiple directives or incorrectly assembles the file because of them.
Comment 3 Steve Ellcey 2009-03-30 16:44:00 UTC
Subject: Bug 38237

Author: sje
Date: Mon Mar 30 16:43:40 2009
New Revision: 145303

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145303
Log:
	PR middle-end/38237
	* tree.h (tree_find_value): New declaration.
	* tree.c (tree_find_value): New function.
	* varasm.c (assemble_external): Avoid duplicate entries on lists.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree.c
    trunk/gcc/tree.h
    trunk/gcc/varasm.c

Comment 4 Steve Ellcey 2009-03-30 16:46:20 UTC
Closing out as fixed in 4.5.  It is probably not worth backporting to 4.4 since it doesn't cause any failures that we know of.