[patch] Fix bogus source locations with optimization

Eric Botcazou ebotcazou@adacore.com
Mon Mar 28 11:17:00 GMT 2011


> This overloads UNKNOWN_LOCATION for both insn_locator and
> source_location, I don't think this is the best idea.  It'll eventually
> break when compiling with C++ anyway.

Could you elaborate?  UNKNOWN_LOCATION isn't used for INSN_LOCATOR at all 
thanks for the curr_insn_locator hunk.

> The expand_gimple_stmt change will cause late diagnostic to
> use an unknown location instead of one from a previously expanded
> stmt.  Probably not ideal but matches what GIMPLE diagnostics
> would have done earlier.

Huh?  What is the line setting input_location for?

> In general I think the patch is a good thing, but the UNKNOWN_LOCATION
> overloading needs to be resolved.  Maybe just add UINKNOWN_LOCATOR?
> The special value also should be documented somewhere (no idea where
> core insn-locator functionality resides).

Well, RTL locators are tested against zero all over the place so it's pretty 
clear what zero means.  I don't see any overloading here.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list