This is the mail archive of the gcc-bugs@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]

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



------- Comment #1 from burnus at gcc dot gnu dot org  2008-04-06 20:38 -------
With the following patch, the message shown is:

      INTEGER, PARAMETER, DIMENSION(10)  :: B = ISHFTC(3, A, 5)   !ICE
                                                      1
Error: Magnitude of second argument of ISHFTC exceeds third argument at (1)

I think there are more places were one should use expr->where instead of
sym->where; however, I do not see ad hoc whether this causes a less helpful
message for variables (as opposed to PARAMETERs); in this case it is simple as
the message states that it is the "second" and the "third" argument, which
makes the possition of the "1" less crutial.


Index: simplify.c
===================================================================
--- simplify.c  (revision 133965)
+++ simplify.c  (working copy)
@@ -1878,37 +1878,37 @@ gfc_expr *
 gfc_simplify_ishft (gfc_expr *e, gfc_expr *s)
 {
   gfc_expr *result;
   int shift, ashift, isize, k, *bits, i;

   if (e->expr_type != EXPR_CONSTANT || s->expr_type != EXPR_CONSTANT)
     return NULL;

   if (gfc_extract_int (s, &shift) != NULL)
     {
-      gfc_error ("Invalid second argument of ISHFT at %L", &s->where);
+      gfc_error ("Invalid second argument of ISHFT at %L", &e->where);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35849


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