public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector
@ 2011-08-03 14:17 wangmianzhi1 at linuxmail dot org
  2011-08-03 14:23 ` [Bug fortran/49962] " dominiq at lps dot ens.fr
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: wangmianzhi1 at linuxmail dot org @ 2011-08-03 14:17 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: "internal compiler error" when using type-bounded
                    function returning vector
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wangmianzhi1@linuxmail.org


Created attachment 24903
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24903
a reduced example

when compiling "reducedcase.f90", a code using type-bounded function returning
vector:
$ gfortran -o reducedcase reducedcase.f90 
reducedcase.f90: In function ‘test’:
reducedcase.f90:18:0: internal compiler error: in gfc_conv_variable, at
fortran/trans-expr.c:551
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.

I think this code should be valid according to fortran 2003 standard.
Even if it is not valid, I think better error handling would be good.
many thanks.

--------------------------------------------------------------------------------
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu
--enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default
--with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 

--------------------------------------------------------------------------------
$ uname -a
Linux mianzhi-laptop 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux


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

* [Bug fortran/49962] "internal compiler error" when using type-bounded function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
@ 2011-08-03 14:23 ` dominiq at lps dot ens.fr
  2011-08-03 14:24 ` wangmianzhi1 at linuxmail dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-08-03 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-08-03 14:22:47 UTC ---
With gfortran 4.6.1 and trunk, the code compiles and gives at run time

           1           2           3

but I get the ICE with 4.5.3. So the bug has been fixed, but not backported to
4.5.


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

* [Bug fortran/49962] "internal compiler error" when using type-bounded function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
  2011-08-03 14:23 ` [Bug fortran/49962] " dominiq at lps dot ens.fr
@ 2011-08-03 14:24 ` wangmianzhi1 at linuxmail dot org
  2011-08-03 15:22 ` burnus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: wangmianzhi1 at linuxmail dot org @ 2011-08-03 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from wangmianzhi <wangmianzhi1 at linuxmail dot org> 2011-08-03 14:24:19 UTC ---
On 2011年08月03日 10:23, dominiq at lps dot ens.fr wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49962
>
> --- Comment #1 from Dominique d'Humieres<dominiq at lps dot ens.fr>  2011-08-03 14:22:47 UTC ---
> With gfortran 4.6.1 and trunk, the code compiles and gives at run time
>
>             1           2           3
>
> but I get the ICE with 4.5.3. So the bug has been fixed, but not backported to
> 4.5.
>
Thank you for your help very much!

Mianzhi


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

* [Bug fortran/49962] "internal compiler error" when using type-bounded function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
  2011-08-03 14:23 ` [Bug fortran/49962] " dominiq at lps dot ens.fr
  2011-08-03 14:24 ` wangmianzhi1 at linuxmail dot org
@ 2011-08-03 15:22 ` burnus at gcc dot gnu.org
  2011-08-04 17:59 ` [Bug fortran/49962] [OOP] ICE when using type-bound " janus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-03 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-03 15:21:23 UTC ---
Thanks for the report. As it is not a regression, I don't think the fix will be
back-ported. Fortunately, it seems to be fixed in 4.6.x and in the current
developer version 4.7.

For using OOP programming features such as type-bound procedures and
polymorphism, it is best to use GCC 4.6 or 4.7. See http://gcc.gnu.org/wiki/OOP
for an overview of fixed and still unfixed OOP bugs by GCC version.

Maybe Ubuntu also has a newer version, which can be installed besides (or
instead of) the system GCC. If not, Debian has GCC 4.6.1 in Testing/Unstable,
cf.
http://packages.debian.org/search?keywords=gfortran&searchon=names&suite=all&section=all

Additionally, unofficial nightly builds of GCC are available from
http://gcc.gnu.org/wiki/GFortranBinaries
Those can also be installed without root permissions in some directory.


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (2 preceding siblings ...)
  2011-08-03 15:22 ` burnus at gcc dot gnu.org
@ 2011-08-04 17:59 ` janus at gcc dot gnu.org
  2011-08-04 18:07 ` wangmianzhi1 at linuxmail dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-04 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org
            Summary|"internal compiler error"   |[OOP] ICE when using
                   |when using type-bounded     |type-bound function
                   |function returning vector   |returning vector

--- Comment #4 from janus at gcc dot gnu.org 2011-08-04 17:58:55 UTC ---
This is certainly a duplicate of PR49961, and has been fixed by r160622, which
could also be backported to the 4.5 branch.

Since we got two apparently independent bug reports for this on the same day:
Is there any "real-world" code which is affected by this bug? Or in other
words: How did you come across this bug?


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (3 preceding siblings ...)
  2011-08-04 17:59 ` [Bug fortran/49962] [OOP] ICE when using type-bound " janus at gcc dot gnu.org
@ 2011-08-04 18:07 ` wangmianzhi1 at linuxmail dot org
  2011-08-04 20:30 ` janus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: wangmianzhi1 at linuxmail dot org @ 2011-08-04 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from wangmianzhi <wangmianzhi1 at linuxmail dot org> 2011-08-04 18:07:07 UTC ---
On 2011年08月04日 13:59, janus at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49962
>
> janus at gcc dot gnu.org changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |janus at gcc dot gnu.org
>              Summary|"internal compiler error"   |[OOP] ICE when using
>                     |when using type-bounded     |type-bound function
>                     |function returning vector   |returning vector
>
> --- Comment #4 from janus at gcc dot gnu.org 2011-08-04 17:58:55 UTC ---
> This is certainly a duplicate of PR49961, and has been fixed by r160622, which
> could also be backported to the 4.5 branch.
>
> Since we got two apparently independent bug reports for this on the same day:
> Is there any "real-world" code which is affected by this bug? Or in other
> words: How did you come across this bug?
We can simply use subroutine instead of function to return vectors. But 
I think it would be definitely not as decent as using functions for the 
case of type-bounded procedures.
I think it would make many people's life easier if this fix could be 
back ported to 4.5, considering the fact that most clusters for 
engineering computation tend to use old compilers.
Thanks.

Mianzhi


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (4 preceding siblings ...)
  2011-08-04 18:07 ` wangmianzhi1 at linuxmail dot org
@ 2011-08-04 20:30 ` janus at gcc dot gnu.org
  2011-08-15 16:06 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-04 20:30 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

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

--- Comment #6 from janus at gcc dot gnu.org 2011-08-04 20:28:09 UTC ---
(In reply to comment #5)
> I think it would make many people's life easier if this fix could be 
> back ported to 4.5, considering the fact that most clusters for 
> engineering computation tend to use old compilers.

Ok, the patch is simple enough after all. If I get approval by another Fortran
maintainer, I'll be happy to do the backport. The original fix of r160622 was
committed by Paul.

So: Paul, Tobias, what do you think? Ok to backport to 4.5?


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (5 preceding siblings ...)
  2011-08-04 20:30 ` janus at gcc dot gnu.org
@ 2011-08-15 16:06 ` burnus at gcc dot gnu.org
  2011-08-16 17:26 ` janus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-15 16:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-15 16:00:48 UTC ---
(In reply to comment #6)
> Ok, the patch is simple enough after all. If I get approval by another Fortran
> maintainer, I'll be happy to do the backport. The original fix of r160622 was
> committed by Paul.

http://gcc.gnu.org/viewcvs?view=revision&revision=160622

> So: Paul, Tobias, what do you think? Ok to backport to 4.5?

I don't mind backporting - the patch is indeed simple and (applying to only to
gfc_conv_derived_to_class) safe.


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (6 preceding siblings ...)
  2011-08-15 16:06 ` burnus at gcc dot gnu.org
@ 2011-08-16 17:26 ` janus at gcc dot gnu.org
  2011-08-16 21:24 ` janus at gcc dot gnu.org
  2011-08-16 21:26 ` janus at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-16 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-08-16
     Ever Confirmed|0                           |1

--- Comment #8 from janus at gcc dot gnu.org 2011-08-16 17:23:30 UTC ---
(In reply to comment #7)
> > So: Paul, Tobias, what do you think? Ok to backport to 4.5?
> 
> I don't mind backporting - the patch is indeed simple and (applying to only to
> gfc_conv_derived_to_class) safe.

Alright then, I'll take care of the backport.


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (7 preceding siblings ...)
  2011-08-16 17:26 ` janus at gcc dot gnu.org
@ 2011-08-16 21:24 ` janus at gcc dot gnu.org
  2011-08-16 21:26 ` janus at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-16 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from janus at gcc dot gnu.org 2011-08-16 21:22:36 UTC ---
Author: janus
Date: Tue Aug 16 21:22:31 2011
New Revision: 177800

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177800
Log:
2011-08-16  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/42051
    PR fortran/43896
    PR fortran/49962
    * trans-expr.c (gfc_conv_derived_to_class): Handle array-valued
    functions with CLASS formal arguments.


2011-08-16  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/42051
    PR fortran/43896
    PR fortran/49962
    * gfortran.dg/class_23.f03: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/class_23.f03
Modified:
    branches/gcc-4_5-branch/gcc/fortran/ChangeLog
    branches/gcc-4_5-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/49962] [OOP] ICE when using type-bound function returning vector
  2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
                   ` (8 preceding siblings ...)
  2011-08-16 21:24 ` janus at gcc dot gnu.org
@ 2011-08-16 21:26 ` janus at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-16 21:26 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

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

--- Comment #10 from janus at gcc dot gnu.org 2011-08-16 21:24:40 UTC ---
Fixed on the 4.5 branch with r177800. Closing.


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

end of thread, other threads:[~2011-08-16 21:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 14:17 [Bug fortran/49962] New: "internal compiler error" when using type-bounded function returning vector wangmianzhi1 at linuxmail dot org
2011-08-03 14:23 ` [Bug fortran/49962] " dominiq at lps dot ens.fr
2011-08-03 14:24 ` wangmianzhi1 at linuxmail dot org
2011-08-03 15:22 ` burnus at gcc dot gnu.org
2011-08-04 17:59 ` [Bug fortran/49962] [OOP] ICE when using type-bound " janus at gcc dot gnu.org
2011-08-04 18:07 ` wangmianzhi1 at linuxmail dot org
2011-08-04 20:30 ` janus at gcc dot gnu.org
2011-08-15 16:06 ` burnus at gcc dot gnu.org
2011-08-16 17:26 ` janus at gcc dot gnu.org
2011-08-16 21:24 ` janus at gcc dot gnu.org
2011-08-16 21:26 ` janus at gcc dot gnu.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).