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]

[gomp4] Remove unnecessary conversions


Hi,

This patch removes the conversion of the arguments. As the
arguments are already of the proper type, via the front
ends, there's no need to the conversion. Furthermore, if
the node is a 'const int', then the conversion function
will create a node that can't be used as an argument to
a gimple call.

Committed to gomp-4_0-branch.


Jim
diff --git a/gcc/ChangeLog.gomp b/gcc/ChangeLog.gomp
index 4d449b0..f2b6c4b 100644
--- a/gcc/ChangeLog.gomp
+++ b/gcc/ChangeLog.gomp
@@ -1,3 +1,7 @@
+2015-06-29  James Norris  <jnorris@codesourcery.com>
+
+	* omp-low.c (expand_omp_target): Remove unnecessary conversion.
+
 2015-06-26  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* config/nvptx/nvptx.md (UNSPEC_ID): Rename to ...
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 5914fcf..24fac7c 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -10138,22 +10138,17 @@ expand_omp_target (struct omp_region *region)
 	  = fold_convert_loc (gimple_location (entry_stmt),
 			      integer_type_node, integer_one_node);
 	/* ..., but if present, use the value specified by the respective
-	   clause, making sure that are of the correct type.  */
+	   clause.  */
 	c = find_omp_clause (clauses, OMP_CLAUSE_NUM_GANGS);
 	if (c)
-	  t_num_gangs = fold_convert_loc (OMP_CLAUSE_LOCATION (c),
-					  integer_type_node,
-					  OMP_CLAUSE_NUM_GANGS_EXPR (c));
+	  t_num_gangs = OMP_CLAUSE_NUM_GANGS_EXPR (c);
 	c = find_omp_clause (clauses, OMP_CLAUSE_NUM_WORKERS);
 	if (c)
-	  t_num_workers = fold_convert_loc (OMP_CLAUSE_LOCATION (c),
-					    integer_type_node,
-					    OMP_CLAUSE_NUM_WORKERS_EXPR (c));
+	  t_num_workers = OMP_CLAUSE_NUM_WORKERS_EXPR (c);
 	c = find_omp_clause (clauses, OMP_CLAUSE_VECTOR_LENGTH);
 	if (c)
-	  t_vector_length = fold_convert_loc (OMP_CLAUSE_LOCATION (c),
-					      integer_type_node,
-					      OMP_CLAUSE_VECTOR_LENGTH_EXPR (c));
+	  t_vector_length = OMP_CLAUSE_VECTOR_LENGTH_EXPR (c);
+	 
 	args.quick_push (t_num_gangs);
 	args.quick_push (t_num_workers);
 	args.quick_push (t_vector_length);

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