This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Refine fix for PR tree-optimization/45470


Hi,

the fix disabled vectorization for all statements that could throw.  That's 
quite heavy-handed because, for -fnon-call-exceptions languages like Ada, 
this means all statements accessing non-stack memory.  The attached patch 
changes this to all statements that can throw internally, which is enough to 
fix the original bug and makes it possible to vectorize in most cases.

Tested on x86_64-suse-linux, OK for the mainline?


2011-02-25  Eric Botcazou  <ebotcazou@adacore.com>

	PR tree-optimization/45470
	* tree-vect-data-refs.c (vect_analyze_data_refs): Fail if a statement
	can throw internally only.
	* tree-vect-stmts.c (vectorizable_call): Likewise.


-- 
Eric Botcazou
Index: tree-vect-data-refs.c
===================================================================
--- tree-vect-data-refs.c	(revision 170437)
+++ tree-vect-data-refs.c	(working copy)
@@ -2578,7 +2578,7 @@ vect_analyze_data_refs (loop_vec_info lo
       offset = unshare_expr (DR_OFFSET (dr));
       init = unshare_expr (DR_INIT (dr));
 
-      if (stmt_could_throw_p (stmt))
+      if (stmt_can_throw_internal (stmt))
         {
           if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
             {
Index: tree-vect-stmts.c
===================================================================
--- tree-vect-stmts.c	(revision 170437)
+++ tree-vect-stmts.c	(working copy)
@@ -1345,7 +1345,7 @@ vectorizable_call (gimple stmt, gimple_s
   if (TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)
     return false;
 
-  if (stmt_could_throw_p (stmt))
+  if (stmt_can_throw_internal (stmt))
     return false;
 
   vectype_out = STMT_VINFO_VECTYPE (stmt_info);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]