------- Comment #11 from jakub at gcc dot gnu dot org 2010-09-22 15:59 ------- The reason why the return stmt, at least after lowering, doesn't have a location, is because after lowering there is just one return instead of possibly multiple returns from before lowering. So the location_t of the individual returns is preserved on the gimple assignments to the RESULT_DECL.
What I just find strange is why is the return stmt involved in the SRA optimization (except as unrelated stmt following the deleted stmt). There was an assignment to RESULT_DECL before that, it had the intended locus of the return from the source, and I'd say that the replacements are connected to that statements if the RESULT_DECL can't be scalarized. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45505