diff mbox

Use vec<>::qsort where possible

Message ID alpine.LSU.2.11.1406171354250.29270@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener June 17, 2014, 11:54 a.m. UTC
Just spotted these.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2014-06-17  Richard Biener  <rguenther@suse.de>

	* genopinit.c (main): Use vec<>::qsort method.
	* tree-ssa-loop-niter.c (discover_iteration_bound_by_body_walk):
	Likewise.
	* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Likewise.
diff mbox

Patch

Index: gcc/genopinit.c
===================================================================
--- gcc/genopinit.c	(revision 211698)
+++ gcc/genopinit.c	(working copy)
@@ -357,8 +357,7 @@  main (int argc, char **argv)
     }
 
   /* Sort the collected patterns.  */
-  qsort (patterns.address (), patterns.length (),
-	 sizeof (pattern), pattern_cmp);
+  patterns.qsort (pattern_cmp);
 
   /* Now that we've handled the "extra" patterns, eliminate them from
      the optabs array.  That way they don't get in the way below.  */
Index: gcc/tree-ssa-loop-niter.c
===================================================================
--- gcc/tree-ssa-loop-niter.c	(revision 211698)
+++ gcc/tree-ssa-loop-niter.c	(working copy)
@@ -3144,8 +3144,7 @@  discover_iteration_bound_by_body_walk (s
     fprintf (dump_file, " Trying to walk loop body to reduce the bound.\n");
 
   /* Sort the bounds in decreasing order.  */
-  qsort (bounds.address (), bounds.length (),
-	 sizeof (widest_int), wide_int_cmp);
+  bounds.qsort (wide_int_cmp);
 
   /* For every basic block record the lowest bound that is guaranteed to
      terminate the loop.  */
Index: gcc/tree-vect-data-refs.c
===================================================================
--- gcc/tree-vect-data-refs.c	(revision 211698)
+++ gcc/tree-vect-data-refs.c	(working copy)
@@ -2508,8 +2530,7 @@  vect_analyze_data_ref_accesses (loop_vec
      linear.  Don't modify the original vector's order, it is needed for
      determining what dependencies are reversed.  */
   vec<data_reference_p> datarefs_copy = datarefs.copy ();
-  qsort (datarefs_copy.address (), datarefs_copy.length (),
-	 sizeof (data_reference_p), dr_group_sort_cmp);
+  datarefs_copy.qsort (dr_group_sort_cmp);
 
   /* Build the interleaving chains.  */
   for (i = 0; i < datarefs_copy.length () - 1;)