------- Comment #7 from jakub at gcc dot gnu dot org 2010-09-17 12:46 ------- You now set the location, but I believe the wrong one. esra changes are: foo (struct S * arg) { + int SR.1; + int s$a; struct S s; struct S D.2694; int D.2690; @@ -72,10 +37,12 @@ foo (struct S * arg) goto <bb 5>;
<bb 4>: - [pr25923.c : 13:7] s = [pr25923.c : 13] *arg_2(D); + [pr25923.c : 13:7] s$a_9 = [pr25923.c : 13] MEM[(struct S *)arg_2(D)]; <bb 5>: - [pr25923.c : 14:3] D.2694 = s; + # s$a_8 = PHI <s$a_7(D)(3), [pr25923.c : 13:7] s$a_9(4)> + [pr25923.c : 14:3] SR.1_10 = s$a_8; + MEM[(struct S *)&D.2694] = SR.1_10; return D.2694; } The added MEM = SR.1_10 uses location_t of the stmt after it, as sra_modify_expr emits statements before gsi. I'm arguing that in this case the MEM[(struct S *)&D.2694] = SR.1_10; stmt is not related to return D.2694, but to D.2694 = s that has been removed and thus I believe it should inherit its locus as well. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45505