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 split_live_ranges_for_shrink_wrap (PR rtl-optimization/59166)


On Tue, Nov 26, 2013 at 09:25:40PM +0100, Jakub Jelinek wrote:
> Hi!
> 
> The problem on this testcase is that we have
> (debug_insn 30 29 31 7 (var_location:HI D#1 (subreg:HI (reg/v:SI 93 [ p ]) 0)) pr59166.c:20 -1
>      (nil))
> and split_live_ranges_for_shrink_wrap decides to replace
> SImode pseudo 93 with some other SImode pseudo.  But it
> uses DF_REF_LOC, which is address of the HImode subreg around the pseudo,
> validate_change succeeds on it, because there is no validation inside of
> debug_insns and then we crash during var-tracking because of a mode
> mismatch.

thanks a lot for fixing it, I had no idea that DF_REF_REAL_LOC even
existed.  This change also apparently makes it possible to throw away
the SUBREG check in the same function.  I'll enqueue a patch removing
it for the next stage1.

> 
> The following patch uses DF_REF_REAL_LOC instead, so that it looks through
> the subreg and adjusts what it should.  Code inspection showed the same
> issue in find_moveable_pseudos, don't have a testcase for that though.

That is where I copied the substitution from.

Martin

> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2013-11-26  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR rtl-optimization/59166
> 	* ira.c (find_moveable_pseudos): Use DF_REF_REAL_LOC instead of
> 	DF_REF_LOC in validate_change call.
> 	(split_live_ranges_for_shrink_wrap): Likewise.
> 
> 	* gcc.dg/torture/pr59166.c: New test.


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