public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24384]  New: SPREAD does not handle scalar sources.
@ 2005-10-15 16:31 pault at gcc dot gnu dot org
  2005-10-15 16:35 ` [Bug fortran/24384] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2005-10-15 16:31 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

EXAMPLE #1

[rt@localhost mytests]# cat spread_r.f90; /gcc-4.1/bin/gfortran spread_r.f90;
./a.out
  character*1 :: i, j(10)
  i = "w"
  j = spread (i, 1, 10)
  end
Fortran runtime error: rank mismatch in spread()

EXAMPLE #2

  character*1 :: j(10)
  j = spread ("w", 1, 10)
  end
spread_r.f90: In function ‘MAIN__’:
spread_r.f90:2: internal compiler error: Segmentation fault

These and other cases with scalar sources all run with g95 and ifc.  This
capability is specified in the standard.

The patch cometh.....


-- 
           Summary: SPREAD does not handle scalar sources.
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: pault at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


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


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

* [Bug fortran/24384] SPREAD does not handle scalar sources.
  2005-10-15 16:31 [Bug fortran/24384] New: SPREAD does not handle scalar sources pault at gcc dot gnu dot org
@ 2005-10-15 16:35 ` pinskia at gcc dot gnu dot org
  2005-10-23  6:59 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-15 16:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-10-15 16:35 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code, wrong-
                   |                            |code
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-15 16:35:19
               date|                            |
            Summary|SPREAD does not handle      |SPREAD does not handle
                   |scalar sources.             |scalar sources.


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


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

* [Bug fortran/24384] SPREAD does not handle scalar sources.
  2005-10-15 16:31 [Bug fortran/24384] New: SPREAD does not handle scalar sources pault at gcc dot gnu dot org
  2005-10-15 16:35 ` [Bug fortran/24384] " pinskia at gcc dot gnu dot org
@ 2005-10-23  6:59 ` cvs-commit at gcc dot gnu dot org
  2005-10-23 15:08 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-23  6:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from cvs-commit at gcc dot gnu dot org  2005-10-23 06:59 -------
Subject: Bug 24384

CVSROOT:        /cvs/gcc
Module name:    gcc
Changes by:     pault@gcc.gnu.org       2005-10-23 06:59:18

Modified files:
        gcc/fortran    : trans-expr.c iresolve.c ChangeLog 
        libgfortran/intrinsics: spread_generic.c 
        libgfortran    : ChangeLog 
        gcc/testsuite  : ChangeLog 
Added files:
        gcc/testsuite/gfortran.dg: assign_func_dtcomp_1.f90 
                                   merge_char_const.f90 
                                   spread_scalar_source.f90 

Log message:
        2005-10-23  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/18022
        * trans-expr.c (gfc_trans_arrayfunc_assign): Return NULL
        if there is a component ref during an array ref to force
        use of temporary in assignment.

        PR fortran/24311
        PR fortran/24384
        * fortran/iresolve.c (check_charlen_present): New function to
        add a charlen to the typespec, in the case of constant
        expressions.
        (gfc_resolve_merge, gfc_resolve_spread): Call.the above.
        (gfc_resolve_spread): Make calls to library functions that
        handle the case of the spread intrinsic with a scalar source.
        * libgfortran/intrinsics/spread_generic.c (spread_internal
        _scalar): New function that handles the special case of spread
        with a scalar source. This has interface functions -
        (spread_scalar, spread_char_scalar): New functions to interface
        with the calls specified in gfc_resolve_spread.

        2005-10-23  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/18022
        gfortran.dg/assign_func_dtcomp_1.f90: New test.

        PR fortran/24311
        gfortran.dg/merge_char_const.f90: New test.

        PR fortran/24384
        gfortran.dg/spread_scalar_source.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&r1=1.65&r2=1.66
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/iresolve.c.diff?cvsroot=gcc&r1=1.42&r2=1.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.592&r2=1.593
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/spread_generic.c.diff?cvsroot=gcc&r1=1.12&r2=1.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.329&r2=1.330
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/assign_func_dtcomp_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/merge_char_const.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/spread_scalar_source.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6234&r2=1.6235


-- 


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


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

* [Bug fortran/24384] SPREAD does not handle scalar sources.
  2005-10-15 16:31 [Bug fortran/24384] New: SPREAD does not handle scalar sources pault at gcc dot gnu dot org
  2005-10-15 16:35 ` [Bug fortran/24384] " pinskia at gcc dot gnu dot org
  2005-10-23  6:59 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-23 15:08 ` pault at gcc dot gnu dot org
  2005-10-23 23:03 ` pinskia at gcc dot gnu dot org
  2005-11-17 18:31 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2005-10-23 15:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2005-10-23 15:08 -------
Fixed in mainline.

Unfortunately, this cannot be fixed in 4.0 because the necessary patches to
permit character valued intriniscs were never implemented.

Paul T


-- 

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


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

* [Bug fortran/24384] SPREAD does not handle scalar sources.
  2005-10-15 16:31 [Bug fortran/24384] New: SPREAD does not handle scalar sources pault at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-10-23 15:08 ` pault at gcc dot gnu dot org
@ 2005-10-23 23:03 ` pinskia at gcc dot gnu dot org
  2005-11-17 18:31 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-23 23:03 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.0


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


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

* [Bug fortran/24384] SPREAD does not handle scalar sources.
  2005-10-15 16:31 [Bug fortran/24384] New: SPREAD does not handle scalar sources pault at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-10-23 23:03 ` pinskia at gcc dot gnu dot org
@ 2005-11-17 18:31 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-17 18:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2005-11-17 18:31 -------
*** Bug 21995 has been marked as a duplicate of this bug. ***


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc-bugzilla at chatsubo dot
                   |                            |lagged dot za dot net


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


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

end of thread, other threads:[~2005-11-17 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-15 16:31 [Bug fortran/24384] New: SPREAD does not handle scalar sources pault at gcc dot gnu dot org
2005-10-15 16:35 ` [Bug fortran/24384] " pinskia at gcc dot gnu dot org
2005-10-23  6:59 ` cvs-commit at gcc dot gnu dot org
2005-10-23 15:08 ` pault at gcc dot gnu dot org
2005-10-23 23:03 ` pinskia at gcc dot gnu dot org
2005-11-17 18:31 ` fxcoudert 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).