Dragan Mladjenovic <dmladjeno...@wavecomp.com> writes: > From: "Dragan Mladjenovic" <dmladjeno...@wavecomp.com> > > This patch prevents merging of CALL instructions that that have different > REG_CALL_DECL notes attached to them. > > On most architectures this is not an important distinction. Usually > instruction patterns > for calls to different functions reference different SYMBOL_REF-s, so they > won't match. > On MIPS PIC calls get split into an got_load/*call_internal pair where the > latter represents > indirect register call w/o SYMBOL_REF attached (until machine_reorg pass). > The bugzilla issue > had such two internal_call-s merged despite the fact that they had different > register usage > information assigned by ipa-ra. > > The check could be improved by checking if ipa-ra has actually assigned two > different > register sets for two functions involved, but I chose to only do a quick > rtx_equal check.
Yeah, I think doing it that would be better (and maybe simpler?). It should just be a case of: get_call_reg_set_usage (i1, &i1_used_regs, call_used_reg_set); get_call_reg_set_usage (i2, &i2_used_regs, call_used_reg_set); and then checking that i1_used_regs and i2_used_regs are equal. Thanks, Richard