public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38918]  New: compile time error for DATA of NULL() to pointer structure component
@ 2009-01-19 22:17 dick dot hendrickson at gmail dot com
  2009-01-20  7:26 ` [Bug fortran/38918] " burnus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2009-01-19 22:17 UTC (permalink / raw)
  To: gcc-bugs

The following program gives a compile time error for a DATA assignment of
NULL() to a structure component.  Probably related to 38917

Dick Hendrickson

      SUBROUTINE PF0009

! fails on Windows XP
! gcc version 4.4.0 20081219 (experimental) [trunk revision 142842] (GCC)

      TYPE  :: HAS_POINTER
        INTEGER, POINTER            :: PTR_S
      END TYPE HAS_POINTER
      TYPE (HAS_POINTER)  ::  PTR_ARRAY(5)

      DATA PTR_ARRAY(1)%PTR_S  /NULL()/

      end subroutine pf0009


C:\gfortran>gfortran try_pf0009.f
try_pf0009.f:11.38:

      DATA PTR_ARRAY(1)%PTR_S  /NULL()/
                                      1
Error: NULL appears on right-hand side in assignment at (1)


-- 
           Summary: compile time error for DATA of NULL() to pointer
                    structure component
           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=38918


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

* [Bug fortran/38918] compile time error for DATA of NULL() to pointer structure component
  2009-01-19 22:17 [Bug fortran/38918] New: compile time error for DATA of NULL() to pointer structure component dick dot hendrickson at gmail dot com
@ 2009-01-20  7:26 ` burnus at gcc dot gnu dot org
  2009-01-22 12:33 ` 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 @ 2009-01-20  7:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-01-20 07:26 -------
Confirm. Thanks for the report.

R532 data-stmt-constant   is ...
                          or null-init

R507 null-init   is function-reference
C506 (R507) The function-reference shall be a reference to the NULL intrinsic
            function with no arguments

Probably a duplicate of PR 38917.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |32834
              nThis|                            |
           Keywords|                            |rejects-valid


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


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

* [Bug fortran/38918] compile time error for DATA of NULL() to pointer structure component
  2009-01-19 22:17 [Bug fortran/38918] New: compile time error for DATA of NULL() to pointer structure component dick dot hendrickson at gmail dot com
  2009-01-20  7:26 ` [Bug fortran/38918] " burnus at gcc dot gnu dot org
@ 2009-01-22 12:33 ` pault at gcc dot gnu dot org
  2009-01-24 12:53 ` 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 @ 2009-01-22 12:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2009-01-22 12:33 -------
This has a trivial fix:

expr.c: 2913 becomes
if (have_pointer && lvalue->symtree->n.sym->attr.data)

Sorry about the lack of a diff - I will remedy this on submission:-)

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|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-01-22 12:33:40
               date|                            |


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


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

* [Bug fortran/38918] compile time error for DATA of NULL() to pointer structure component
  2009-01-19 22:17 [Bug fortran/38918] New: compile time error for DATA of NULL() to pointer structure component dick dot hendrickson at gmail dot com
  2009-01-20  7:26 ` [Bug fortran/38918] " burnus at gcc dot gnu dot org
  2009-01-22 12:33 ` pault at gcc dot gnu dot org
@ 2009-01-24 12:53 ` pault at gcc dot gnu dot org
  2009-03-31 20:07 ` pault at gcc dot gnu dot org
  2009-04-06 10:54 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-01-24 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2009-01-24 12:53 -------
Created an attachment (id=17174)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17174&action=view)
Fix for the PR - 

OK'd http://gcc.gnu.org/ml/fortran/2009-01/msg00297.html

2009-01-22  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/38917
       * expr.c (gfc_check_assign): Allow pointer components when
       checking for NULL.

       PR fortran/38918
       * resolve.c (check_data_variable): Treat pointer arrays with
       scalars.

2009-01-22  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/38917
       PR fortran/38918
       * gfortran.dg/data_pointer_1.f90: New test.


-- 


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


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

* [Bug fortran/38918] compile time error for DATA of NULL() to pointer structure component
  2009-01-19 22:17 [Bug fortran/38918] New: compile time error for DATA of NULL() to pointer structure component dick dot hendrickson at gmail dot com
                   ` (2 preceding siblings ...)
  2009-01-24 12:53 ` pault at gcc dot gnu dot org
@ 2009-03-31 20:07 ` pault at gcc dot gnu dot org
  2009-04-06 10:54 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-03-31 20:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2009-03-31 20:06 -------
Subject: Bug 38918

Author: pault
Date: Tue Mar 31 20:05:44 2009
New Revision: 145371

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145371
Log:
2009-03-31  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/38917
        * expr.c (gfc_check_assign): Allow pointer components when
        checking for NULL.

        PR fortran/38918
        * resolve.c (check_data_variable): Treat pointer arrays with
        scalars.

2009-03-31  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/38917
        PR fortran/38918
        * gfortran.dg/data_pointer_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/data_pointer_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/38918] compile time error for DATA of NULL() to pointer structure component
  2009-01-19 22:17 [Bug fortran/38918] New: compile time error for DATA of NULL() to pointer structure component dick dot hendrickson at gmail dot com
                   ` (3 preceding siblings ...)
  2009-03-31 20:07 ` pault at gcc dot gnu dot org
@ 2009-04-06 10:54 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-04-06 10:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2009-04-06 10:54 -------
Fixed on trunk.  I am prepared to backport but the mood appears to be against
it.

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=38918


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

end of thread, other threads:[~2009-04-06 10:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-19 22:17 [Bug fortran/38918] New: compile time error for DATA of NULL() to pointer structure component dick dot hendrickson at gmail dot com
2009-01-20  7:26 ` [Bug fortran/38918] " burnus at gcc dot gnu dot org
2009-01-22 12:33 ` pault at gcc dot gnu dot org
2009-01-24 12:53 ` pault at gcc dot gnu dot org
2009-03-31 20:07 ` pault at gcc dot gnu dot org
2009-04-06 10:54 ` 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).