diff mbox

[fortran] Bug 35849 - "wrong" line shown in error message for parameter

Message ID c897817f-6674-00e8-5683-62abc2c4313b@charter.net
State New
Headers show

Commit Message

Jerry DeLisle July 4, 2016, 7:14 p.m. UTC
I will commit attached patch provided by Steve and reviewed and tested 
by myself to trunk.  Test case provided.

Self explanatory.

Regards,

Jerry

2016-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/35849
	* simplify.c (gfc_simplify_ishftc): Check that absolute value of
	SHIFT is less than or equal to SIZE.
diff mbox

Patch

Index: simplify.c
===================================================================
--- simplify.c	(revision 237855)
+++ simplify.c	(working copy)
@@ -3280,7 +3280,6 @@  gfc_simplify_ishftc (gfc_expr *e, gfc_ex
 	return NULL;
 
       gfc_extract_int (sz, &ssize);
-
     }
   else
     ssize = isize;
@@ -3294,7 +3293,10 @@  gfc_simplify_ishftc (gfc_expr *e, gfc_ex
     {
       if (sz == NULL)
 	gfc_error ("Magnitude of second argument of ISHFTC exceeds "
-		   "BIT_SIZE of first argument at %L", &s->where);
+		   "BIT_SIZE of first argument at %C");
+      else
+	gfc_error ("Absolute value of SHIFT shall be less than or equal "
+		   "to SIZE at %C");
       return &gfc_bad_expr;
     }