RFD: marking a variable as addressable - need new hook? (pr26004)

Joern RENNECKE joern.rennecke@st.com
Mon Jan 30 19:41:00 GMT 2006


gimplify.c:gimplify_modify_expr_rhs tries to optimize calls to functions 
which return their value in memory, if the result is assigned to a 
variable, by using the address of that variable as the location where 
the result is top be stored.  It uses lang_hooks.mark_addressable to 
mark the variable
as addressable.
There is a preceding check that is supposed to verify that the variable 
is not a register variable,  but the function called - 
is_gimple_reg_type - is really more a heuristic for optimizations.
The necessary information to decide if we can safely call 
lang_hooks.mark_addressable is not available in a frontend-independet 
manner.  I think we need a new frontend hook that can tell an optimizer 
if a call to lang_hooks.mark_addressable  would succeed.



More information about the Gcc mailing list