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]

Re: [PATCH] Reset or update VR during phiopt value_replacement (PR tree-optimization/65053)


On 02/13/15 12:52, Jakub Jelinek wrote:
Hi!

When moving assignment out of a conditional block before the condition, we
need to either reset or update SSA_NAME_RANGE_INFO, otherwise it might be
wrong, because when computed earlier, it could take into account that in
the conditional block the condition is or is not true.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2015-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/65053
	* tree-ssa-phiopt.c (value_replacement): When moving assign before
	cond, either reset VR on lhs or set it to phi result VR.

	* gcc.c-torture/execute/pr65053-1.c: New test.
	* gcc.c-torture/execute/pr65053-2.c: New test.
OK.

I wouldn't be terribly surprised if we have a variety of these kind of bugs lurking. Basically everything which moves statements like this potentially needs updating.

jeff


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