This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[libgfortran, patch] Missing return in intrinsics/pack_generic.c


Dear all,

In the giant switch statement in intrinsics/pack_generic.c, one of the branches is missing a return statement after the call to pack_i8. Because all branches are otherwise identical and feature the return statement, I consider it obvious.

Because the generic pack_internal() function will be called after pack_i8(), this probably leads to suboptimal performance, but not to wrong results (the second packing should be a noop). I've certainly not managed to create a testcase that would trigger it, so none was committed.

Bootstrapped and regtested on x86_64-linux, OK to commit?
FX




2010-09-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	* intrinsics/pack_generic.c (pack): Add missing return.



Index: intrinsics/pack_generic.c
===================================================================
--- intrinsics/pack_generic.c	(revision 164213)
+++ intrinsics/pack_generic.c	(working copy)
@@ -374,6 +373,7 @@ pack (gfc_array_char *ret, const gfc_arr
 	{
 	  pack_i8 ((gfc_array_i8 *) ret, (gfc_array_i8 *) array,
 		   (gfc_array_l1 *) mask, (gfc_array_i8 *) vector);
+	  return;
 	}
 
 #ifdef HAVE_GFC_INTEGER_16


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