public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Parse tree weirdness?
@ 2003-04-09  8:53 Stephen Biggs
  0 siblings, 0 replies; only message in thread
From: Stephen Biggs @ 2003-04-09  8:53 UTC (permalink / raw)
  To: GCC list

Given the following (from gcc/testsuite/gcc.dg/attr-used.c):

static void function_declaration_after(void) {}
static void function_declaration_after(void) __attribute__((__used__));

... note that the prototype is AFTER the function definition, defining
new attributes for this function.

I am doing this in GCC 3.2 and the document at
http://gcc.gnu.org/onlinedocs/gccint/ only defines
TARGET_ENCODE_SECTION_INFO instead of ENCODE_SECTION_INFO which I am
using.  GCC 3.2.2 differences? Is this the same macro besides the
additional argument for new_decl_p?

What I notice is that ENCODE_SECTION_INFO gets called first and only
once, which is being used in my code for emitting function declaration
data, and then TARGET_ASM_FUNCTION_PROLOGUE is called, once, which I use
to actually write out the function beginning.

The weird part here is that when either of these macro functions are
entered, there are not any attributes. According to the documentation,
the parsing is over and code/RTL generation is in progress. If so, then
why isn't the "used" attribute defined for this function by the
following prototype present in the tree that I am handed?

I am probably missing something simple that could be found by RTFM'ing,
and if anybody can point me to the proper documentation, I would
appreciate it.  I am definitely unclear on a few concepts.

Thanks for any advice.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-09  7:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-09  8:53 Parse tree weirdness? Stephen Biggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).