Getting knowledge of common declarations at the time they are declared in the source
Richard Henderson
rth@redhat.com
Fri May 9 21:12:00 GMT 2003
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~
More information about the Gcc
mailing list