------- Comment #4 from bonzini at gnu dot org  2009-03-24 15:03 -------
The only thing to be careful is to have set_reg_equal == FALSE if the insn has
multiple sets, and find which set in a multiple-set insn is actually referring
to USE (a combination of note_stores and loc_mentioned_in_p will do).  Such a
patch is definitely backportable to 4.4 even if it is not ready for 4.4.0.

However, I'm not sure it is good to have the best possible addressing mode in
an asm, because I wonder if this could cause other kinds of reload failure. 
Think of:

   char p[10];
   ...
   a = b * 4 + c;
   asm ("" : : "m" (p[a]))

Which fwprop would likely change to a base/index/displacement address, with 2
registers gone.

Setting cse_not_expected in practice would not use an addressing mode that is
more complicated than the one specified by the user; for an asm, I think this
is actually the least surprising behavior.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39543

Reply via email to