Patchwork [libgfortran] Missing return in intrinsics/pack_generic.c

login
register
mail settings
Submitter FX
Date Sept. 12, 2010, 11:44 a.m.
Message ID <0412D7B7-8E47-4FC6-8D2E-5EDE8F03B2D3@gmail.com>
Download mbox | patch
Permalink /patch/64547/
State New
Headers show

Comments

FX - Sept. 12, 2010, 11:44 a.m.
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.
Thomas Koenig - Sept. 12, 2010, 12:39 p.m.
Hi FX,


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

OK.  Thanks for catching this!

	Thomas

Patch

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