Patchwork [GOOGLE] use expand_location when checking same_line_p

login
register
mail settings
Submitter Dehao Chen
Date July 1, 2013, 11:22 p.m.
Message ID <CAO2gOZWkp6S05ukHFhjO1CTh6svTrkraX5UO21ygB-sLn_Gheg@mail.gmail.com>
Download mbox | patch
Permalink /patch/256241/
State New
Headers show

Comments

Dehao Chen - July 1, 2013, 11:22 p.m.
This patch replaces expand_location_to_spelling_point with
expand_location so that macros will not be expanded.

Bootstrapped and passed regression test.

OK for google-4_8 branch?

Thanks,
Dehao
Cary Coutant - July 1, 2013, 11:28 p.m.
> This patch replaces expand_location_to_spelling_point with
> expand_location so that macros will not be expanded.

I'm confused. Doesn't this just undo the fix you made a month ago? How
does this not break discriminator assignment?

-cary
Dehao Chen - July 1, 2013, 11:46 p.m.
This patch does not break the regression test. And because the final
assembly is emitted with "expand_location" instead of
"expand_location_to_spelling_point", thus when we check same_line_p,
it should also reflect this.

Dehao

On Mon, Jul 1, 2013 at 4:28 PM, Cary Coutant <ccoutant@google.com> wrote:
>> This patch replaces expand_location_to_spelling_point with
>> expand_location so that macros will not be expanded.
>
> I'm confused. Doesn't this just undo the fix you made a month ago? How
> does this not break discriminator assignment?
>
> -cary
Cary Coutant - July 2, 2013, 8:58 p.m.
>>> This patch replaces expand_location_to_spelling_point with
>>> expand_location so that macros will not be expanded.

OK for google/gcc-4_8.

-cary

Patch

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c (revision 200584)
+++ gcc/tree-cfg.c (working copy)
@@ -732,8 +732,8 @@  same_line_p (location_t locus1, location_t locus2)
   if (locus1 == locus2)
     return true;

-  from = expand_location_to_spelling_point (locus1);
-  to = expand_location_to_spelling_point (locus2);
+  from = expand_location (locus1);
+  to = expand_location (locus2);

   if (from.line != to.line)
     return false;