This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Parse tree weirdness?


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]