This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] record extern weak decls in assemble_external
- From: "Diego Novillo" <dnovillo at google dot com>
- To: "Rafael Espindola" <espindola at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Fri, 25 Jul 2008 18:05:57 -0300
- Subject: Re: [patch] record extern weak decls in assemble_external
- References: <38a0d8450807240644u34e8a393w4b07d6dc03d3ddee@mail.gmail.com>
On Thu, Jul 24, 2008 at 10:44, Rafael Espindola <espindola@google.com> wrote:
> 2008-07-24 Rafael Espindola <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.
You have changed the meaning of the predicate in a confusing way. The
original code did:
- else if (SUPPORTS_WEAK)
- {
- if (! DECL_WEAK (decl))
- weak_decls = tree_cons (NULL, decl, weak_decls);
- }
The new version does:
+ if (SUPPORTS_WEAK && DECL_WEAK (decl))
+ weak_decls = tree_cons (NULL, decl, weak_decls);
It seems as if the old version was wrong, it would only add non-weak
DECLs to the list. But if so, how did it use to work?
Diego.