https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125857
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mjambor at suse dot cz
--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
Ah, this is the issue I misplaced and couldn't find.
The expression &e is gimple_min_invariant, at least when it started... but when
it propagates from IPA, IPA clears the context, so we fail the
decl_function_context (op) == current_function_decl
comparison in decl_address_invariant_p.
<bb 2> :
b.3_1 = b;
_2 = d ();
*b.3_1 = _2;
return 0;
ipa_return_value_range causes VRP to replace d() with "&e" to main:
Folding statement: _2 = d ();
Using return value range of d: [prange] int * [1, +INF] -> &e { Base: &e ;
Size: [irange] sizetype [8, 8] }
but the context isn't being set.. And VRP isn't aware it needs setting.
Question for Martin... is this something that ipa_return_value_range () can
set?
And is this even valid? we aren't inlining, and the function is returning the
address of a local. so there is no 'e' in main. Is this something that IPA
ought not be propagating?