public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Alan Lawrence <alan.lawrence@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix PR68067
Date: Mon, 30 Nov 2015 08:52:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1511300939560.4884@t29.fhfr.qr> (raw)
In-Reply-To: <56589E4B.1080405@arm.com>

On Fri, 27 Nov 2015, Alan Lawrence wrote:

> On 27/11/15 15:07, Alan Lawrence wrote:
> > On 23/11/15 09:43, Richard Biener wrote:
> > > On Fri, 20 Nov 2015, Alan Lawrence wrote:
> > > 
> > > > ...the asserts
> > > > you suggested in
> > > > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D68117#c27)...
> >  >>
> > > > So I have to ask, how sure are you that those assertions are(/should
> > > > be!) "correct"? :)
> > > 
> > > Ideally they should be correct but they happen to be not (and I think
> > > the intent was that this should be harmless).  Basically I tried
> > > to assert that nobody creates stale edge redirect data that is not
> > > later consumed or cleared.  Happens to be too optimistic :/
> > 
> > Maybe so, but it looks like the edge_var_redirect_map is still suspect here.
> > On
> > the ~~28th call to loop_version, from tree_unswitch_loop, the call to
> > lv_flush_pending_stmts executes (tree-cfg.c flush_pending_stmts):
> > 
> >             def = redirect_edge_var_map_def (vm);
> >             add_phi_arg (phi, def, e, redirect_edge_var_map_location(vm));
> > 
> > and BLOCK_LOCATION (redirect_edge_var_map_location(vm)) is
> > 
> > <<invalid tree code> 0x7fb7704a80 side-effects addressable asm_written used
> > protected static visited tree_0 tree_2 tree_5>
> > 
> > so yeah, next question, how'd that get there...
> > 
> > A.
> 
> Well, pass_dominator::execute calls redirect_edge_var_map with that edge
> pointer, at which time the edge is from from 32 (0x7fb79cc6e8) to block 20
> (0x7fb7485e38), and locus is 2147483884; and then again, with locus 0.
> 
> With no intervening calls to redirect_edge_var_map_clear for that edge,
> loop_version's call to flush_pending_statements then reads
> redirect_edge_var_map_vector for that edge pointer - which is now an edge from
> block 126 (0x7fb7485af8) to 117 (0x7fb74856e8). It sees those locations
> (2147483884 and 0)...
> 
> Clearing the edge redirect map at the end of pass_dominator fixes the ICE (as
> would clearing it at the end of each stage, or clearing it at the beginning of
> loop_unswitch, I guess).
> 
> I'll post a patch after more testing, but obviously I'm keen to hear if there
> are obvious problems with the approach?
> 
> And coming up with a testcase, well, heh - this broke because of identical
> pointers to structures allocated at different times, with intervening
> free...ideas welcome of course!

Yeah.  I've pondered with clearing the hashmap after each pass
(and hope no IPA pass would redirect edges).  Or even more aggressive,
clear the hashmap as well when we do set_cfun ().

Maybe you can try that?

And no, I don't think any pass expects this stuff to be live across
passes.

Richard.

  reply	other threads:[~2015-11-30  8:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 12:50 Richard Biener
2015-10-27 14:31 ` Richard Biener
2015-10-28 13:43   ` Richard Biener
2015-11-06 10:31     ` Alan Lawrence
2015-11-06 10:39       ` Richard Biener
2015-11-06 12:24         ` Alan Lawrence
2015-11-06 12:26           ` Richard Biener
2015-11-06 16:11             ` Jeff Law
2015-11-20 17:28         ` Alan Lawrence
2015-11-23  9:44           ` Richard Biener
2015-11-27 16:24             ` Alan Lawrence
2015-11-27 18:26               ` Alan Lawrence
2015-11-30  8:52                 ` Richard Biener [this message]
2015-11-30 17:01                   ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.11.1511300939560.4884@t29.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=alan.lawrence@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).