Ian Lance Taylor-3 wrote: > > Dobes <bdo...@udel.edu> writes: > >>>> See the SYMBOL_REF_FLAGS stuff in rtl.h and various examples in the >>>> back-ends. >>> Or, better, look for uses of lookup_attribute. >>> >> >> OK, I've now got it working for globals and static locals by tagging the >> rtl >> in "encode_section_info" and checking for that tag later. How can I do >> the >> same for locals? > > Use lookup_attribute. In fact, use that instead of > encode_section_info. > > Ian > >
Could you clarify a little about how/where to use lookup_attribute? Right now, I am using lookup_attribute in encode_section_info to set the flag on the globals: my_encode_section_info(...) { ... if(TREE_CODE (DECL) == VAR_DECL && lookup_attribute("myAttr", DECL_ATTRIBUTES(DECL))) { SYMBOL_REF_FLAGS(XEXP (rtl, 0)) |= SYMBOL_MYATTR_FLAG; } } As I mentioned, this allows me to flag all of the globals/static locals but does nothing for locals. -- View this message in context: http://www.nabble.com/Getting-variable-attribute-from-rtx-tp22745207p22790978.html Sent from the gcc - Dev mailing list archive at Nabble.com.