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]

Re: How to get m/c dependent attributes from RTL (expressions, nota variable)?


Balaji S wrote:
I have introduced m/c dependent attributes and handling it's semantics via the attribute's handler. And i want to use these attributes during assembly printing from RTL. How to get these attributes?

This isn't how attributes are normally used. They are normally used for changing how variables/functions are defined, and how we emit RTL to access them.


There is no guarantee that tree info for variable declarations will still be accessible when converting RTL insns to assembly. There is also the problem that the optimizer can do various things to memory load/store instructions. There may not be a one-to-one correspondence between loads and variables, and hence no guarantee that you have a usable mem_expr. If you need something special here, it really needs to be done when the RTL is emitted, not when the assembly is emitted.

Did step through, function 'print_rtx' to have a look at how the above RTL being printed. Especially memory attributes [4 g_i3+0 S2 A16]. But not able to get DECL_ATTRIBUTES of 'g_i3'.

Seems like this is something you should have been able to figure out yourself. If you already looked at print_rtx, then you should know that the the variable decl is printed from print_decl_name. A quick grep shows the definition of DECL_ATTRIBUTES in tree.h. Just apply the definition to node and you have the attribute list for the decl.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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