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]

RTL/SYMREF/VOLATILE question


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Greetings,

If I have an RTL fragment such as:
rtx bar;
bar = gen_rtx_SYMBOL_REF(Pmode,"*foo");
this generates exactly the code I need, but then if I optimize, it gets moved 
and even deleted in the final target output.

SYMBOL_REF_FLAG (bar) = 1; has no effect, of course.

Using, instead:

rtx bar;
bar = gen_rtx_MEM(Pmode,gen_rtx_SYMBOL_REF(Pmode,"*foo"));
MEM_VOLATILE_P(bar) = 1;

now acts correctly for me in terms of optimization, but adds an extra level of 
indirection which I have to account for in the following code generation.

Is there a simple way to do what I want (that is, get the least amount of 
indirection possible for a SYMREF and be optimization safe?)

Thanks for any help.
-----BEGIN PGP SIGNATURE-----

iD8DBQFADR75rT0x/nxLkjwRAzlOAJ9PFePJXb2xl653rvEui8SdwIzAvgCfReJ3
SGAqVcbobv/Sk4ohSXsB1m0=
=v+9s
-----END PGP SIGNATURE-----


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