public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35779]  New: error pointer wrong in PARAMETER
@ 2008-03-31 19:47 dick dot hendrickson at gmail dot com
  2008-03-31 19:57 ` [Bug fortran/35779] " burnus at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2008-03-31 19:47 UTC (permalink / raw)
  To: gcc-bugs

The error message thingo points to the wrong place in the
bad line and/or gives a misleading diagnostic.  This isn't
all that important.  I only found it because I'm trying to
find the source of an internal compiler error and if I mess
around with things, this one crops up and hides the other.

Dick Hendrickson

       module bad_message
! fails on Windows XP
! gcc version 4.4.0 20080312 (experimental) [trunk revision 133139]



      integer,PARAMETER :: I3(10) = (/(J1,  J1=10,1,-1)/)

      integer,PARAMETER :: I2(10) = (/(J1,  J1=its_bad,1,-1)/)

      end module

gfortran%gfortran module_bad_message.f
module_bad_message.f:9.38:

      integer,PARAMETER :: I2(10) = (/(J1,  J1=its_bad,1,-1)/)
                                     1
Error: Invalid character in name at (1)


-- 
           Summary: error pointer wrong in PARAMETER
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
@ 2008-03-31 19:57 ` burnus at gcc dot gnu dot org
  2008-12-11 20:18 ` kargl at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-03-31 19:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-03-31 19:56 -------
Confirm.

NAG f95 has:
  Error: ITS_BAD is not permitted in an initialisation expression

ifort:
  Error: This symbol must be a defined parameter or an argument of an inquiry
function that evaluates to a compile-time constant.   [ITS_BAD]

openf95/sunf95:
  "ITS_BAD" has the DATA initialized attribute.  It must not be used in an
initialization expression because it is not a constant.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-31 19:56:29
               date|                            |
            Summary|error pointer wrong in      |error pointer wrong in
                   |PARAMETER                   |PARAMETER


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
  2008-03-31 19:57 ` [Bug fortran/35779] " burnus at gcc dot gnu dot org
@ 2008-12-11 20:18 ` kargl at gcc dot gnu dot org
  2010-05-09 20:03 ` dfranke at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-12-11 20:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kargl at gcc dot gnu dot org  2008-12-11 20:17 -------
For some reason, init_flag in gfc_match_iterator is set to zero.
So when the matcher hits

  m = init_flag ? gfc_match_init_expr (&e1) : gfc_match_expr (&e1);

gfc_match_expr() is executed instead of gfc_match_init_expr().
By forcibly set init_flag=1 in gdb, gfortran then generates

% gfc4x -c pr35778.f90
pr35779.f90:2.43:

  integer,PARAMETER :: I2(10) = (/ (J1, J1=its_bad,1,-1) /)
                                          1
Error: Parameter 'its_bad' at (1) has not been declared or is a variable,
which does not reduce to a constant expression

Still hunting for a place to properly set init_flag.


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
  2008-03-31 19:57 ` [Bug fortran/35779] " burnus at gcc dot gnu dot org
  2008-12-11 20:18 ` kargl at gcc dot gnu dot org
@ 2010-05-09 20:03 ` dfranke at gcc dot gnu dot org
  2010-05-09 20:44 ` kargl at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-09 20:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2010-05-09 20:02 -------
Experimental patch below gives:

$ gfortran-svn -Wall -W pr35779.f90 
pr35779.f90:3.44:

  integer, PARAMETER :: I2(10) = (/ (J1, J1=its_bad, 1, -1) /)
                                            1
Error: Parameter 'its_bad' at (1) has not been declared or is a variable, which
does not reduce to a constant expression


Some cleanup and regtesting is needed, though.



Index: array.c
===================================================================
--- array.c     (revision 159195)
+++ array.c     (working copy)
@@ -847,7 +847,7 @@ check_duplicate_iterator (gfc_constructo
 static match match_array_cons_element (gfc_constructor_base *);

 /* Match a list of array elements.  */
-
+extern bool init_flag;
 static match
 match_array_list (gfc_constructor_base *result)
 {
@@ -879,7 +879,7 @@ match_array_list (gfc_constructor_base *

   for (n = 1;; n++)
     {
-      m = gfc_match_iterator (&iter, 0);
+      m = gfc_match_iterator (&iter, init_flag);
       if (m == MATCH_YES)
        break;
       if (m == MATCH_ERROR)


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-03-31 19:56:29         |2010-05-09 20:02:58
               date|                            |


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (2 preceding siblings ...)
  2010-05-09 20:03 ` dfranke at gcc dot gnu dot org
@ 2010-05-09 20:44 ` kargl at gcc dot gnu dot org
  2010-05-09 20:57 ` dfranke at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-05-09 20:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kargl at gcc dot gnu dot org  2010-05-09 20:44 -------
(In reply to comment #3)
> Experimental patch below gives:
> 
> $ gfortran-svn -Wall -W pr35779.f90 
> pr35779.f90:3.44:
> 
>   integer, PARAMETER :: I2(10) = (/ (J1, J1=its_bad, 1, -1) /)
>                                             1
> Error: Parameter 'its_bad' at (1) has not been declared or is a variable, which
> does not reduce to a constant expression
> 
> 
> Some cleanup and regtesting is needed, though.
> 
> 
> 
> Index: array.c
> ===================================================================
> --- array.c     (revision 159195)
> +++ array.c     (working copy)
> @@ -847,7 +847,7 @@ check_duplicate_iterator (gfc_constructo
>  static match match_array_cons_element (gfc_constructor_base *);
> 
>  /* Match a list of array elements.  */
> -
> +extern bool init_flag;
>  static match
>  match_array_list (gfc_constructor_base *result)
>  {
> @@ -879,7 +879,7 @@ match_array_list (gfc_constructor_base *
> 
>    for (n = 1;; n++)
>      {
> -      m = gfc_match_iterator (&iter, 0);
> +      m = gfc_match_iterator (&iter, init_flag);
>        if (m == MATCH_YES)
>         break;
>        if (m == MATCH_ERROR)


I tried a similar patch, but it fell apart during testing.
Unfortunately, I can't remember what tripped up the patch.


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (3 preceding siblings ...)
  2010-05-09 20:44 ` kargl at gcc dot gnu dot org
@ 2010-05-09 20:57 ` dfranke at gcc dot gnu dot org
  2010-05-13 12:30 ` dfranke at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-09 20:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dfranke at gcc dot gnu dot org  2010-05-09 20:57 -------
(In reply to comment #4)
> I tried a similar patch, but it fell apart during testing.
> Unfortunately, I can't remember what tripped up the patch.

Testing passed without issues here?!

However, before submitting I'd like to add some cleanup; expr.c has
gfc_init_expr and init_flag, both being used for the same purpose. Can be
rolled into one patch.


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (4 preceding siblings ...)
  2010-05-09 20:57 ` dfranke at gcc dot gnu dot org
@ 2010-05-13 12:30 ` dfranke at gcc dot gnu dot org
  2010-05-13 14:08 ` dfranke at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-13 12:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dfranke at gcc dot gnu dot org  2010-05-13 12:30 -------
Patch:
    http://gcc.gnu.org/ml/fortran/2010-05/msg00130.html


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (5 preceding siblings ...)
  2010-05-13 12:30 ` dfranke at gcc dot gnu dot org
@ 2010-05-13 14:08 ` dfranke at gcc dot gnu dot org
  2010-05-13 14:09 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-13 14:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dfranke at gcc dot gnu dot org  2010-05-13 14:08 -------
Subject: Bug 35779

Author: dfranke
Date: Thu May 13 14:08:05 2010
New Revision: 159366

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159366
Log:
gcc/fortran/:
2010-05-13  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/35779
        * intrinsic.c (gfc_init_expr): Renamed to gfc_init_expr_flag.
        Updated all usages.
        * expr.c (init_flag): Removed; use gfc_init_expr_flag everywhere.
        * array.c (match_array_list): Pass on gfc_init_expr_flag when matching
        iterators.

gcc/testsuite/:
2010-05-13  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/35779
        * gfortran.dg/initialization_25.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/initialization_25.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/arith.c
    trunk/gcc/fortran/array.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (6 preceding siblings ...)
  2010-05-13 14:08 ` dfranke at gcc dot gnu dot org
@ 2010-05-13 14:09 ` dfranke at gcc dot gnu dot org
  2010-05-16 20:01 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-13 14:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dfranke at gcc dot gnu dot org  2010-05-13 14:09 -------
Fixed in trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.0


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (7 preceding siblings ...)
  2010-05-13 14:09 ` dfranke at gcc dot gnu dot org
@ 2010-05-16 20:01 ` dfranke at gcc dot gnu dot org
  2010-05-16 20:03 ` dfranke at gcc dot gnu dot org
  2010-05-16 20:05 ` dfranke at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-16 20:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dfranke at gcc dot gnu dot org  2010-05-16 20:01 -------
Subject: Bug 35779

Author: dfranke
Date: Sun May 16 20:01:06 2010
New Revision: 159465

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159465
Log:
gcc/fortran/:
2010-05-16  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/35779
        * array.c (match_array_list): Revert functional change of 2010-05-13.

gcc/fortran/:
2010-05-16  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/35779
        * gfortran.dg/initialization_25.f90: Commented testcase.
        * gfortran.dg/initialization_26.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/initialization_26.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/array.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/initialization_25.f90


-- 


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (8 preceding siblings ...)
  2010-05-16 20:01 ` dfranke at gcc dot gnu dot org
@ 2010-05-16 20:03 ` dfranke at gcc dot gnu dot org
  2010-05-16 20:05 ` dfranke at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-16 20:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dfranke at gcc dot gnu dot org  2010-05-16 20:03 -------
(In reply to comment #9)
> 2010-05-16  Daniel Franke  <franke.daniel@gmail.com>
> 
>         PR fortran/35779
>         * array.c (match_array_list): Revert functional change of 2010-05-13.

Back to square one.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/35779] error pointer wrong in PARAMETER
  2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
                   ` (9 preceding siblings ...)
  2010-05-16 20:03 ` dfranke at gcc dot gnu dot org
@ 2010-05-16 20:05 ` dfranke at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-16 20:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from dfranke at gcc dot gnu dot org  2010-05-16 20:05 -------
Relevant ML discussion starts here:
    http://gcc.gnu.org/ml/fortran/2010-05/msg00165.html

Unassigning myself.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|dfranke at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|REOPENED                    |NEW


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-05-16 20:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-31 19:47 [Bug fortran/35779] New: error pointer wrong in PARAMETER dick dot hendrickson at gmail dot com
2008-03-31 19:57 ` [Bug fortran/35779] " burnus at gcc dot gnu dot org
2008-12-11 20:18 ` kargl at gcc dot gnu dot org
2010-05-09 20:03 ` dfranke at gcc dot gnu dot org
2010-05-09 20:44 ` kargl at gcc dot gnu dot org
2010-05-09 20:57 ` dfranke at gcc dot gnu dot org
2010-05-13 12:30 ` dfranke at gcc dot gnu dot org
2010-05-13 14:08 ` dfranke at gcc dot gnu dot org
2010-05-13 14:09 ` dfranke at gcc dot gnu dot org
2010-05-16 20:01 ` dfranke at gcc dot gnu dot org
2010-05-16 20:03 ` dfranke at gcc dot gnu dot org
2010-05-16 20:05 ` dfranke at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).