https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116898

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Jakub Jelinek from comment #2)
> The bitint lowering pass emits some gimple statements on edges
> (gsi_insert_on_edge) and the edge insertions are (intentionally) committed
> to edges only at the end of pass (gsi_commit_edge_inserts ()).
> So, what the gimple cache sees here is an SSA_NAME set in a stmt queued on
> edge.
> 
> Either the range cache can be adjusted not to fail assertion in cases like
> that but just pretend it doesn't know the range of something not yet in the
> IL (perhaps under some flag), or I'll need to revamp the pass to repeat the
> handle_operand_addr and .{ADD,SUB}_OVERFLOW discovery to find out where
> range_to_prec -> range_of_expr would be actually called, remember it in some
> hash table or whatever data structure and then during actual pass don't use
> range_of_expr anymore and just look up what has been remembered.  If the
> former would be possible, I'd certainly prefer that.


It should be perfectly safe to return false instead of trapping on that line. 
The routine already returns false if it can't produce a range on entry.   We've
added similar functionality at other places to have stmts that are no yet in
the IL, we just haven't tripped over this one before.

Reply via email to