Patchwork Fix PR middle-end/54759

login
register
mail settings
Submitter Dehao Chen
Date Sept. 30, 2012, 7:03 p.m.
Message ID <CAO2gOZUmqAMJvYFz1YQjBAcxPtTnNH23WvkNEgO7vwD595-X+Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/188190/
State New
Headers show

Comments

Dehao Chen - Sept. 30, 2012, 7:03 p.m.
Hi,

This patch fixes the bug when comparing location to UNKNOWN_LOC.

Bootstrapped and passed gcc regression test.

Okay for trunk?

Thanks,
Dehao

2012-09-30  Dehao Chen  <dehao@google.com>

PR middle-end/54759
* gcc/tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Use
LOCATION_LOCUS to compare with UNKNOWN_LOCATION.
(slpeel_tree_peel_loop_to_edge): Likewise.
* gcc/tree-vectorizer.c (vectorize_loops): Likewise.
Richard Guenther - Oct. 1, 2012, 9:42 a.m.
On Sun, Sep 30, 2012 at 9:03 PM, Dehao Chen <dehao@google.com> wrote:
> Hi,
>
> This patch fixes the bug when comparing location to UNKNOWN_LOC.
>
> Bootstrapped and passed gcc regression test.
>
> Okay for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> Dehao
>
> 2012-09-30  Dehao Chen  <dehao@google.com>
>
> PR middle-end/54759
> * gcc/tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Use
> LOCATION_LOCUS to compare with UNKNOWN_LOCATION.
> (slpeel_tree_peel_loop_to_edge): Likewise.
> * gcc/tree-vectorizer.c (vectorize_loops): Likewise.

Patch

Index: gcc/tree-vect-loop-manip.c
===================================================================
--- gcc/tree-vect-loop-manip.c	(revision 191876)
+++ gcc/tree-vect-loop-manip.c	(working copy)
@@ -793,7 +793,7 @@  slpeel_make_loop_iterate_ntimes (struct loop *loop
   loop_loc = find_loop_location (loop);
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
-      if (loop_loc != UNKNOWN_LOC)
+      if (LOCATION_LOCUS (loop_loc) != UNKNOWN_LOC)
         fprintf (dump_file, "\nloop at %s:%d: ",
                  LOC_FILE (loop_loc), LOC_LINE (loop_loc));
       print_gimple_stmt (dump_file, cond_stmt, 0, TDF_SLIM);
@@ -1248,7 +1248,7 @@  slpeel_tree_peel_loop_to_edge (struct loop *loop,
       loop_loc = find_loop_location (loop);
       if (dump_file && (dump_flags & TDF_DETAILS))
         {
-          if (loop_loc != UNKNOWN_LOC)
+          if (LOCATION_LOCUS (loop_loc) != UNKNOWN_LOC)
             fprintf (dump_file, "\n%s:%d: note: ",
                      LOC_FILE (loop_loc), LOC_LINE (loop_loc));
           fprintf (dump_file, "tree_duplicate_loop_to_edge_cfg failed.\n");
Index: gcc/tree-vectorizer.c
===================================================================
--- gcc/tree-vectorizer.c	(revision 191876)
+++ gcc/tree-vectorizer.c	(working copy)
@@ -192,7 +192,7 @@  vectorize_loops (void)
 	loop_vec_info loop_vinfo;
 
 	vect_location = find_loop_location (loop);
-        if (vect_location != UNKNOWN_LOC
+        if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
             && vect_verbosity_level > REPORT_NONE)
 	  fprintf (vect_dump, "\nAnalyzing loop at %s:%d\n",
             LOC_FILE (vect_location), LOC_LINE (vect_location));
@@ -203,7 +203,7 @@  vectorize_loops (void)
 	if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
 	  continue;
 
-        if (vect_location != UNKNOWN_LOC
+        if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
             && vect_verbosity_level > REPORT_NONE)
           fprintf (vect_dump, "\n\nVectorizing loop at %s:%d\n",
             LOC_FILE (vect_location), LOC_LINE (vect_location));