public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58989] New: internal compiler error when using reshape function
@ 2013-11-04 20:44 firefox84 at freenet dot de
  2013-11-04 21:42 ` [Bug fortran/58989] [Regression] " kargl at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: firefox84 at freenet dot de @ 2013-11-04 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58989
           Summary: internal compiler error when using reshape function
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: firefox84 at freenet dot de

When trying to compile this code


PROGRAM test

  REAL(KIND=KIND(1.0d0)), DIMENSION(4,4) :: fluxes
  REAL(KIND=KIND(1.0d0)), DIMENSION(2,2,2,2) :: f
  INTEGER, DIMENSION(3) :: dmmy 

  dmmy = (/2,2,2/)

  f = reshape(fluxes,(/dmmy,2/))

END PROGRAM test


with:     gfortran -v -o test test.f90


I get this error message:


Driving: gfortran -mmacosx-version-min=10.7.4 -v -o test test.f90 -l gfortran
-shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin11.3.0/4.7.0/lto-wrapper
Target: x86_64-apple-darwin11.3.0
Configured with: ../gcc-4.7.0-RC-20120314/configure --enable-languages=fortran
Thread model: posix
gcc version 4.7.0 20120314 (prerelease) (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-v' '-o' 'test'
'-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin11.3.0/4.7.0/f951 test.f90 -fPIC
-quiet -dumpbase test.f90 -mmacosx-version-min=10.7.4 -mtune=core2 -auxbase
test -version -fintrinsic-modules-path
/usr/local/lib/gcc/x86_64-apple-darwin11.3.0/4.7.0/finclude -o
/var/folders/f1/w3v6_9qn33s8grk9ktdq0mxw0000gp/T//ccrVOpIo.s
GNU Fortran (GCC) version 4.7.0 20120314 (prerelease)
(x86_64-apple-darwin11.3.0)
    compiled by GNU C version 4.7.0 20120314 (prerelease), GMP version 4.3.1,
MPFR version 2.4.1, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.7.0 20120314 (prerelease)
(x86_64-apple-darwin11.3.0)
    compiled by GNU C version 4.7.0 20120314 (prerelease), GMP version 4.3.1,
MPFR version 2.4.1, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
f951: internal compiler error: Segmentation fault: 11
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug fortran/58989] [Regression] internal compiler error when using reshape function
  2013-11-04 20:44 [Bug fortran/58989] New: internal compiler error when using reshape function firefox84 at freenet dot de
@ 2013-11-04 21:42 ` kargl at gcc dot gnu.org
  2013-11-05  1:19 ` sgk at troutmask dot apl.washington.edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2013-11-04 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-04
                 CC|                            |kargl at gcc dot gnu.org
      Known to work|                            |4.2.5, 4.3.6, 4.4.7
            Summary|internal compiler error     |[Regression] internal
                   |when using reshape function |compiler error when using
                   |                            |reshape function
     Ever confirmed|0                           |1
      Known to fail|                            |4.5.4, 4.6.4, 4.7.4, 4.8.2,
                   |                            |4.9.0

--- Comment #1 from kargl at gcc dot gnu.org ---
Confirmed.


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

* [Bug fortran/58989] [Regression] internal compiler error when using reshape function
  2013-11-04 20:44 [Bug fortran/58989] New: internal compiler error when using reshape function firefox84 at freenet dot de
  2013-11-04 21:42 ` [Bug fortran/58989] [Regression] " kargl at gcc dot gnu.org
@ 2013-11-05  1:19 ` sgk at troutmask dot apl.washington.edu
  2013-11-05 20:04 ` kargl at gcc dot gnu.org
  2013-11-05 22:48 ` kargl at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2013-11-05  1:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Mon, Nov 04, 2013 at 09:40:39PM +0000, kargl at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58989
> 
> kargl at gcc dot gnu.org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>    Last reconfirmed|                            |2013-11-04
>                  CC|                            |kargl at gcc dot gnu.org
>       Known to work|                            |4.2.5, 4.3.6, 4.4.7
>             Summary|internal compiler error     |[Regression] internal
>                    |when using reshape function |compiler error when using
>                    |                            |reshape function
>      Ever confirmed|0                           |1
>       Known to fail|                            |4.5.4, 4.6.4, 4.7.4, 4.8.2,
>                    |                            |4.9.0
> 
> --- Comment #1 from kargl at gcc dot gnu.org ---
> Confirmed.
> 

This appears to fix the issue.  I'm running the testsuite
now.


Index: check.c
===================================================================
--- check.c    (revision 204372)
+++ check.c    (working copy)
@@ -3277,7 +3277,7 @@ gfc_check_reshape (gfc_expr *source, gfc
          "than %d elements", &shape->where, GFC_MAX_DIMENSIONS);
       return false;
     }
-  else if (shape->expr_type == EXPR_ARRAY)
+  else if (shape->expr_type == EXPR_ARRAY && gfc_is_constant_expr (shape))
     {
       gfc_expr *e;
       int i, extent;


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

* [Bug fortran/58989] [Regression] internal compiler error when using reshape function
  2013-11-04 20:44 [Bug fortran/58989] New: internal compiler error when using reshape function firefox84 at freenet dot de
  2013-11-04 21:42 ` [Bug fortran/58989] [Regression] " kargl at gcc dot gnu.org
  2013-11-05  1:19 ` sgk at troutmask dot apl.washington.edu
@ 2013-11-05 20:04 ` kargl at gcc dot gnu.org
  2013-11-05 22:48 ` kargl at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2013-11-05 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Tue Nov  5 20:02:43 2013
New Revision: 204419

URL: http://gcc.gnu.org/viewcvs?rev=204419&root=gcc&view=rev
Log:
2013-11-05  Steven G. Kargl <kargl@gcc.gnu.org>

    PR fortran/58989
    * check.c (gfc_check_reshape): ensure that shape is a constant
    expression.

2013-11-05  Steven G. Kargl <kargl@gcc.gnu.org>

    PR fortran/58989
    * gfortran.dg/reshape_6.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/reshape_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/58989] [Regression] internal compiler error when using reshape function
  2013-11-04 20:44 [Bug fortran/58989] New: internal compiler error when using reshape function firefox84 at freenet dot de
                   ` (2 preceding siblings ...)
  2013-11-05 20:04 ` kargl at gcc dot gnu.org
@ 2013-11-05 22:48 ` kargl at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2013-11-05 22:48 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

--- Comment #5 from kargl at gcc dot gnu.org ---
Fixed on trunk and 4.8 branch.  Closing.
Thanks for the bug report.


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

end of thread, other threads:[~2013-11-05 22:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-04 20:44 [Bug fortran/58989] New: internal compiler error when using reshape function firefox84 at freenet dot de
2013-11-04 21:42 ` [Bug fortran/58989] [Regression] " kargl at gcc dot gnu.org
2013-11-05  1:19 ` sgk at troutmask dot apl.washington.edu
2013-11-05 20:04 ` kargl at gcc dot gnu.org
2013-11-05 22:48 ` kargl 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).