public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34335]  New: valid code rejected when reordering USE statements
@ 2007-12-04 13:37 jaydub66 at gmail dot com
  2007-12-04 13:44 ` [Bug fortran/34335] [4.3 Regression] " jaydub66 at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jaydub66 at gmail dot com @ 2007-12-04 13:37 UTC (permalink / raw)
  To: gcc-bugs

Consider the following piece of code:


module A
  type A_type
    real comp
  end type
end module A

module B
  use A
  private
  type(A_type) :: B_var
  public:: B_var
end module B

program C
  use B
  use A
  type(A_type):: A_var
end program C


This is rejected with the error message

  type(A_type):: A_var
             1
Error: Derived type 'a_type' at (1) is being used before it is defined

Please note that the error is only thrown under the condition that the USE
statements in program C appear in the same order as shown above. When you
exchange them and put "use A" first (or remove "use B"), then the error goes
away. This makes me wonder if this bug is somehow related to PR33295.

Also the error only appears with the funny combination of PUBLIC and PRIVATE in
module B. Admittedly, it looks a little strange and is not very useful, but
nevertheless I think it's valid Fortran (someone correct me if I'm wrong).


-- 
           Summary: valid code rejected when reordering USE statements
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jaydub66 at gmail dot com


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
@ 2007-12-04 13:44 ` jaydub66 at gmail dot com
  2007-12-04 14:55 ` jaydub66 at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jaydub66 at gmail dot com @ 2007-12-04 13:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jaydub66 at gmail dot com  2007-12-04 13:44 -------
The code above fails for recent trunk builds (rev. 130582) on
i686-pc-linux-gnu, but is known to work for 4.2.1 as well as 4.3.0 rev. 127773
(from August 24, 2007).


-- 

jaydub66 at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
      Known to fail|                            |4.3.0
      Known to work|                            |4.2.1
            Summary|valid code rejected when    |[4.3 Regression] valid code
                   |reordering USE statements   |rejected when reordering USE
                   |                            |statements


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
  2007-12-04 13:44 ` [Bug fortran/34335] [4.3 Regression] " jaydub66 at gmail dot com
@ 2007-12-04 14:55 ` jaydub66 at gmail dot com
  2007-12-04 19:07 ` burnus at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jaydub66 at gmail dot com @ 2007-12-04 14:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jaydub66 at gmail dot com  2007-12-04 14:55 -------
The error also appears on x86_64. It must have been introduced somewhere
between Nov. 23 and 26:
- rev. 130365 works
- rev. 130431 fails


-- 


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
  2007-12-04 13:44 ` [Bug fortran/34335] [4.3 Regression] " jaydub66 at gmail dot com
  2007-12-04 14:55 ` jaydub66 at gmail dot com
@ 2007-12-04 19:07 ` burnus at gcc dot gnu dot org
  2007-12-04 20:35 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-04 19:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2007-12-04 19:07 -------
Paul, do you have an idea? My (un)educated guess is that the fix for PR 33541
(patch to not import "y" when using "use foo; use foo, only: x => y") caused
this.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot org


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (2 preceding siblings ...)
  2007-12-04 19:07 ` burnus at gcc dot gnu dot org
@ 2007-12-04 20:35 ` burnus at gcc dot gnu dot org
  2007-12-04 21:16 ` jaydub66 at gmail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-04 20:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-04 20:35:07
               date|                            |


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (3 preceding siblings ...)
  2007-12-04 20:35 ` burnus at gcc dot gnu dot org
@ 2007-12-04 21:16 ` jaydub66 at gmail dot com
  2007-12-04 22:07 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jaydub66 at gmail dot com @ 2007-12-04 21:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jaydub66 at gmail dot com  2007-12-04 21:16 -------
(In reply to comment #3)
> Paul, do you have an idea? My (un)educated guess is that the fix for PR 33541
> (patch to not import "y" when using "use foo; use foo, only: x => y") caused
> this.

I don't think your guess is uneducated at all. I nailed the error down to
revision 130395, which is Paul's fix for PR33541.


-- 


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (4 preceding siblings ...)
  2007-12-04 21:16 ` jaydub66 at gmail dot com
@ 2007-12-04 22:07 ` burnus at gcc dot gnu dot org
  2007-12-05 15:18 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-04 22:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2007-12-04 22:06 -------
*** Bug 34339 has been marked as a duplicate of this bug. ***


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |william dot mitchell at nist
                   |                            |dot gov


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (5 preceding siblings ...)
  2007-12-04 22:07 ` burnus at gcc dot gnu dot org
@ 2007-12-05 15:18 ` pault at gcc dot gnu dot org
  2007-12-06  6:14 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-12-05 15:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-12-05 15:18 -------
(In reply to comment #5)
> *** Bug 34339 has been marked as a duplicate of this bug. ***
> 

OK Thanks all - I'm onto 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|2007-12-04 20:35:07         |2007-12-05 15:18:19
               date|                            |


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (6 preceding siblings ...)
  2007-12-05 15:18 ` pault at gcc dot gnu dot org
@ 2007-12-06  6:14 ` pault at gcc dot gnu dot org
  2007-12-06  6:15 ` pault at gcc dot gnu dot org
  2007-12-06  7:06 ` burnus at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-12-06  6:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2007-12-06 06:14 -------
Subject: Bug 34335

Author: pault
Date: Thu Dec  6 06:13:59 2007
New Revision: 130643

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

        PR fortran/34335
        * module.c (find_symbol): Do not return symtrees with unique
        names, which shows that they are private.

2007-12-06  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/34335
        * gfortran.dg/used_types_19.f90: New test.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (7 preceding siblings ...)
  2007-12-06  6:14 ` pault at gcc dot gnu dot org
@ 2007-12-06  6:15 ` pault at gcc dot gnu dot org
  2007-12-06  7:06 ` burnus at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-12-06  6:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pault at gcc dot gnu dot org  2007-12-06 06:14 -------
Fixed on trunk

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


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

* [Bug fortran/34335] [4.3 Regression] valid code rejected when reordering USE statements
  2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
                   ` (8 preceding siblings ...)
  2007-12-06  6:15 ` pault at gcc dot gnu dot org
@ 2007-12-06  7:06 ` burnus at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-06  7:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from burnus at gcc dot gnu dot org  2007-12-06 07:06 -------
The actual commit is:
http://gcc.gnu.org/viewcvs?view=rev&revision=130642

Thanks for the fix!


-- 


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


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

end of thread, other threads:[~2007-12-06  7:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-04 13:37 [Bug fortran/34335] New: valid code rejected when reordering USE statements jaydub66 at gmail dot com
2007-12-04 13:44 ` [Bug fortran/34335] [4.3 Regression] " jaydub66 at gmail dot com
2007-12-04 14:55 ` jaydub66 at gmail dot com
2007-12-04 19:07 ` burnus at gcc dot gnu dot org
2007-12-04 20:35 ` burnus at gcc dot gnu dot org
2007-12-04 21:16 ` jaydub66 at gmail dot com
2007-12-04 22:07 ` burnus at gcc dot gnu dot org
2007-12-05 15:18 ` pault at gcc dot gnu dot org
2007-12-06  6:14 ` pault at gcc dot gnu dot org
2007-12-06  6:15 ` pault at gcc dot gnu dot org
2007-12-06  7:06 ` burnus 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).