This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to get m/c dependent attributes from RTL (expressions, nota variable)?
- From: James E Wilson <wilson at specifixinc dot com>
- To: Balaji S <sivanbalaji at acmet dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 09 Feb 2005 19:06:54 -0800
- Subject: Re: How to get m/c dependent attributes from RTL (expressions, nota variable)?
- References: <420366A1.20607@acmet.com>
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