This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH PR62151]Fix uninitialized register issue caused by distribute_notes in combine pass


Hi
As reported in bug pr62151, combine pass may wrongly delete necessary
instruction in function distribute_notes thus leaving register
uninitialized.  This patch is to fix the issue by checking if i2 immediately
modifies the register in REG_DEAD note.  If yes, set tem_insn accordingly to
start finding right place for note distribution from i2.

I once sent a RFC patch at
https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01718.html, but got no
comments,  here I added some comments in this patch to make it a formal one.


I tested the original patch, and will re-test it against the latest code
later.  So is it OK?  Any comments will be appreciated.

Thanks,
bin

2014-08-27  Bin Cheng  <bin.cheng@arm.com>

	PR rtl-optimization/62151
	* combine.c (distribute_notes): Check i2 if it modifies register
	in REG_DEAD note immediately, set tem_insn accordingly.

Attachment: pr62151-20140827.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]