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] Fix -fcompare-debug bugs during updating into loop closed ssa form (PR debug/80436)


On 04/19/2017 07:55 AM, Jakub Jelinek wrote:
Hi!

-fcompare-debug fails on the following testcase, because during loop
splitting we attempt to switch into loop closed SSA form and use
also debug stmt uses in those decisions, which is wrong.
Looking at the rest of tree-ssa-loop-manip.c, both find_uses_to_rename_stmt
and check_loop_closed_ssa_stmt ignore debug stmts, this patch just adds
that to another spot.  Without it a new SSA_NAME is created (only with -g)
and then soon (in the next pass) removed again because DCE sees it as
dead (it has no non-debug uses) and is replaced by the definition from the
loop again.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2017-04-19  Jakub Jelinek  <jakub@redhat.com>

	PR debug/80436
	* tree-ssa-loop-manip.c (find_uses_to_rename_def): Ignore debug uses.

	* g++.dg/opt/pr80436.C: New test.
OK.
jeff


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