This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35849] "wrong" line shown in error message for parameter
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Apr 2008 20:38:50 -0000
- Subject: [Bug fortran/35849] "wrong" line shown in error message for parameter
- References: <bug-35849-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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