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] combine: Fix PR80233


On 03/29/2017 02:44 PM, Jakub Jelinek wrote:
On Wed, Mar 29, 2017 at 02:35:32PM -0600, Jeff Law wrote:
On 03/29/2017 12:23 PM, Segher Boessenkool wrote:
If combine has added an unconditional trap there will be a new basic
block as well.  It will then end up considering the NOTE_INSN_BASIC_BLOCK
as the last_combined_insn, but then it tries to take the DF_INSN_LUID
of that and that dereferences a NULL pointer (since such a note is not
an INSN_P).

This fixes it by not taking non-insns as last_combined_insn.

Bootstrapped and tested on powerpc64-linux {-m32,-m64}.


Segher


2017-03-29  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/80233
	* combine.c (combine_instructions): Only take NONDEBUG_INSN_P insns
	as last_combined_insn.  Do not test for BARRIER_P separately.

gcc/testsuite/
	PR rtl-optimization/80233
	* gcc.c-torture/compile/pr80233.c: New testcase.
No strong opinions on this vs Jakub's patch.  I guess yours may walk more
objects on the chain, but in doing so is more likely to find a useful
LAST_COMBINED_INSN.  Jakub's stops earlier, but is less likely to have
stopped on something useful.

Your call Segher.

I like Segher's latest patch.  But it is his call anyway ;)
In that case let's just go with Segher's patch :-)

jeff


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