[PATCH] volatile global register variable

David Edelsohn dje@watson.ibm.com
Wed Nov 9 19:39:00 GMT 2005


>>>>> Daniel Jacobowitz writes:

Dan> Could you explain what these times are, for the curious?

	The issue is how much one expects GCC to try to optimize code
using global register variables and how much one wants GCC to try to
prevent it.  At some level this is going to become a DWIM scenario if GCC
does not allow the programmer to inform the compiler where it is and is
not safe using attributes like volatile.

	Some constituency is going to be unhappy if GCC inhibits all
optimizations on global register variables.  Another constituency is going
to be upset if GCC applies an aggressive optimization and there is no way
to disable the optimization without generating warnings that cannot be
silenced.

	GCC disables some Tree-SSA and RTL optimizations on VAR_DECLs
marked as DECL_HARD_REGISTER, but not all.  In Tree-SSA, is_gimple_reg()
returns false for variables marked DECL_HARD_REGISTER, but some GCC
optimization checks allow SSA copy propagation to be applied to global
register variables.  GCC may not try to apply that transformation now, but
it might in the future.  Trying to catch every DECL_HARD_REGISTER case in
current and future optimization passes seems like design for failure.

David



More information about the Gcc-patches mailing list