Ping
http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01002.html
http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01003.html
and
http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01596.html

The last one needs a tweak.
s/FUNCTION_VALUE_REGNO_P/targetm.calls.function_value_regno_p/,
or wrap the whole patch in #ifdef FUNCTION_VALUE_REGNO_P.  Perhaps I
should explain more than what I wrote in the comment too.  For targets
like powerpc that pass function arguments in registers and return a
function result in the same register as one of the arguments, the
ifcvt optimization can prevent shrink wrapping.  Without the ifcvt
optimization for a function "int foo (int x)" we might have something
like

 r29 = r3; // save r3 in callee saved reg
 if (some test) goto exit_label
 // main body of foo, calling other functions
 r3 = 0;
 return;
exit_label:
 r3 = 1;
 return;

Bernd's http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00380.html quite
happily rearranges the r29 assignment to be after the "if", and shrink
wrapping occurs.  With the ifcvt optimization we get

 r29 = r3; // save r3 in callee saved reg
 r3 = 1;
 if (some test) goto exit_label
 // main body of foo, calling other functions
 r3 = 0;
exit_label:
 return;

and now the r29 assignment cannot be moved past the "if", disabling
shrink wrap.

-- 
Alan Modra
Australia Development Lab, IBM

Reply via email to