On Fri, Aug 10, 2012 at 10:52 AM, Richard Henderson <r...@redhat.com> wrote: > On 2012-08-10 10:21, Dehao Chen wrote: >> Yes, cxx_maybe_build_cleanup sets it to UNKNOWN_LOCATION, but during >> gimplifying, it's reset to input_location: >> >> gimplify.c (gimplify_call_expr) >> 2486 /* For reliable diagnostics during inlining, it is necessary that >> 2487 every call_expr be annotated with file and line. */ >> 2488 if (! EXPR_HAS_LOCATION (*expr_p)) >> 2489 SET_EXPR_LOCATION (*expr_p, input_location); >> >> Shall we remove this code? Because I don't expect the location to be >> unknown in other cases. > > Hmm. Perhaps something special-cased to TRY_FINALLY/TRY_CATCH > to set input_location itself to UNKNOWN_LOCATION for the duration > of gimplifying the cleanup? With a big comment about how we'll be > setting unset locations for cleanups during tree-eh lowering.
Handling TRY_FINALLY/TRY_CATCH case may not work for Java, as it also shares gimplify.c Or, shall we create a routine in cp frontend to let gimplify.c know that a call_expr is auto-generated dtor, so that gimplify will not set its location to input_location? Thanks, Dehao > > > r~