public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36371]  New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement
@ 2008-05-29 14:19 dominiq at lps dot ens dot fr
  2008-05-29 21:06 ` [Bug fortran/36371] " burnus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-05-29 14:19 UTC (permalink / raw)
  To: gcc-bugs

The first test case in PR36319 gives now:

    character(len=3, kind=4), parameter, dimension(3) :: mychar = [ "abc", "def
                                                                  1
Error: Incompatible types in assignment at (1); attempted assignment of
CHARACTER(4) to CHARACTER(1)

which does not look right. The following codelet from FX:

program chkdata
  character(len=3), parameter :: mychar(3) = [ "abc", "def", "ghi" ]
  integer :: c(5)
  data c / mychar(1), mychar(2), mychar(3), mychar(1), mychar(2) /
end program chkdata

gives with gfortran 4.3/4.4:

  character(len=3), parameter :: mychar(3) = [ "abc", "def", "ghi" ]
                                             1
Error: Incompatible types in assignment at (1); attempted assignment of
CHARACTER(1) to INTEGER(4)

but with gfortran 4.2:

  data c / mychar(1), mychar(2), mychar(3), mychar(1), mychar(2) /
                1
Error: Syntax error in DATA statement at (1)

pointing to the right locus of the error.


-- 
           Summary: [4.3/4.4 Regression] Wrong locus for errors in DATA
                    statement
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr


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


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

* [Bug fortran/36371] [4.3/4.4 Regression] Wrong locus for errors in DATA statement
  2008-05-29 14:19 [Bug fortran/36371] New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement dominiq at lps dot ens dot fr
@ 2008-05-29 21:06 ` burnus at gcc dot gnu dot org
  2008-06-07 16:17 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-29 21:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
           Priority|P3                          |P5
   Last reconfirmed|0000-00-00 00:00:00         |2008-05-29 21:05:37
               date|                            |
   Target Milestone|---                         |4.4.0


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


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

* [Bug fortran/36371] [4.3/4.4 Regression] Wrong locus for errors in DATA statement
  2008-05-29 14:19 [Bug fortran/36371] New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement dominiq at lps dot ens dot fr
  2008-05-29 21:06 ` [Bug fortran/36371] " burnus at gcc dot gnu dot org
@ 2008-06-07 16:17 ` pault at gcc dot gnu dot org
  2008-06-24 21:46 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-06-07 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2008-06-07 16:17 -------
(In reply to comment #0)

This comes about, indirectly, because of simplification.  Change the the index
of the first item in the data list for 'c' to 2, for example.  This can be
tracked back to resolve.c (check_data_variable), where the call to
gfc_check_assign is gfc_check_assign (var->expr, values.vnode->expr, 0); The
rvalue, values.vnode->expr, is used for the locus in the error.  Since it has
been simplfied here, the error results.  Using the lvalue expression at least
hits the data statement.

I notice that the only customer for gfc_check_assign with 'conform' == 0 is
check_data_variable.  It might be better to take account of this in the call.

I'll do it.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-05-29 21:05:37         |2008-06-07 16:17:12
               date|                            |


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


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

* [Bug fortran/36371] [4.3/4.4 Regression] Wrong locus for errors in DATA statement
  2008-05-29 14:19 [Bug fortran/36371] New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement dominiq at lps dot ens dot fr
  2008-05-29 21:06 ` [Bug fortran/36371] " burnus at gcc dot gnu dot org
  2008-06-07 16:17 ` pault at gcc dot gnu dot org
@ 2008-06-24 21:46 ` pault at gcc dot gnu dot org
  2008-09-03 12:28 ` [Bug fortran/36371] [4.3 " domob at gcc dot gnu dot org
  2008-09-03 21:08 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-06-24 21:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2008-06-24 21:45 -------
Subject: Bug 36371

Author: pault
Date: Tue Jun 24 21:44:28 2008
New Revision: 137088

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137088
Log:
2008-06-24  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/34371
        * expr.c (gfc_check_assign):  Change message and locus for
        error when conform == 0.

2008-06-24  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/36371
        * gfortran.dg/data_array_5.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/data_array_5.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/interface.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/36371] [4.3 Regression] Wrong locus for errors in DATA statement
  2008-05-29 14:19 [Bug fortran/36371] New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement dominiq at lps dot ens dot fr
                   ` (2 preceding siblings ...)
  2008-06-24 21:46 ` pault at gcc dot gnu dot org
@ 2008-09-03 12:28 ` domob at gcc dot gnu dot org
  2008-09-03 21:08 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-09-03 12:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from domob at gcc dot gnu dot org  2008-09-03 12:27 -------
Subject: Bug 36371

Author: domob
Date: Wed Sep  3 12:25:57 2008
New Revision: 139936

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139936
Log:
2008-08-30  Daniel Kraft  <d@domob.eu>

        PR fortran/37193
        * module.c (read_module): Initialize use_only flag on used symbols.

2008-08-30  Daniel Kraft  <d@domob.eu>

        PR fortran/37193
        * gfortran.dg/use_rename_4.f90: New test.
        * gfortran.dg/use_rename_5.f90: New test.

2008-06-24  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/36371
        * gfortran.dg/data_array_5.f90: New test.

2008-06-24  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/36371
        * expr.c (gfc_check_assign):  Change message and locus for
        error when conform == 0.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/data_array_5.f90
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/use_rename_4.f90
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/use_rename_5.f90
Modified:
    branches/gcc-4_3-branch/gcc/fortran/ChangeLog
    branches/gcc-4_3-branch/gcc/fortran/expr.c
    branches/gcc-4_3-branch/gcc/fortran/module.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/36371] [4.3 Regression] Wrong locus for errors in DATA statement
  2008-05-29 14:19 [Bug fortran/36371] New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement dominiq at lps dot ens dot fr
                   ` (3 preceding siblings ...)
  2008-09-03 12:28 ` [Bug fortran/36371] [4.3 " domob at gcc dot gnu dot org
@ 2008-09-03 21:08 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-09-03 21:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2008-09-03 21:06 -------
Fixed on trunk and 4.3.

Thanks for the report.

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-09-03 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-29 14:19 [Bug fortran/36371] New: [4.3/4.4 Regression] Wrong locus for errors in DATA statement dominiq at lps dot ens dot fr
2008-05-29 21:06 ` [Bug fortran/36371] " burnus at gcc dot gnu dot org
2008-06-07 16:17 ` pault at gcc dot gnu dot org
2008-06-24 21:46 ` pault at gcc dot gnu dot org
2008-09-03 12:28 ` [Bug fortran/36371] [4.3 " domob at gcc dot gnu dot org
2008-09-03 21:08 ` pault 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).