This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Getting knowledge of common declarations at the time they are declared in the source
- From: Richard Henderson <rth at redhat dot com>
- To: Alexandre Courbot <Alexandre dot Courbot at lifl dot fr>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Fri, 9 May 2003 14:09:32 -0700
- Subject: Re: Getting knowledge of common declarations at the time they are declared in the source
- References: <200305091929.14443.Alexandre.Courbot@lifl.fr>
On Fri, May 09, 2003 at 07:29:14PM +0200, Alexandre Courbot wrote:
> Therefore ASM_OUTPUT_COMMON for randomvar will be called *after* the code for
> foo is generated, which means after references to randomvar are outputted.
Yes, this is required because a COMMON variable is tentative.
We won't know whether it's really common until the end of the
translation unit.
> Because of this behavior, I don't have any (known) way to build my custom
> informations about randomvar before it is used, since I use the
> ASM_OUTPUT_COMMON hook to build them. So my backend cannot perform correctly.
On mainline do have SYMBOL_REF_DECL, which will tell you that
the variable is still tentative, ie still DECL_COMMON.
r~