public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54223] New: Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls
@ 2012-08-10 14:21 roger.ferrer at bsc dot es
  2012-08-10 19:05 ` [Bug fortran/54223] " burnus at gcc dot gnu.org
  2014-01-05 13:01 ` dominiq at lps dot ens.fr
  0 siblings, 2 replies; 3+ messages in thread
From: roger.ferrer at bsc dot es @ 2012-08-10 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54223
           Summary: Statement function statement with dummy arguments that
                    are also OPTIONAL may crash in wrong calls
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: roger.ferrer@bsc.es


Hi,

in the following non-conformant Fortran snippet

SUBROUTINE S(X)
    IMPLICIT NONE
    INTEGER, OPTIONAL :: X
    INTEGER :: F, Y

    ! Statement function statement
    F(X) = X + 1

    ! This call to F is wrong, it requires an actual argument here
    ! despite the X being OPTIONAL
    Y = F()
END SUBROUTINE S

causes gfortran 4.7.1 to crash

$ gfortran -c test.f90
test.f90: In function 's':
test.f90:11:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.

I think that the OPTIONAL attribute is confusing gfortran when it checks
the (wrong) call to F.

Removing the OPTIONAL attribute results in gfortran properly diagnosing the
missing actual argument.

Kind regards,


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

* [Bug fortran/54223] Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls
  2012-08-10 14:21 [Bug fortran/54223] New: Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls roger.ferrer at bsc dot es
@ 2012-08-10 19:05 ` burnus at gcc dot gnu.org
  2014-01-05 13:01 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-10 19:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
      Known to fail|                            |4.1.2, 4.8.0

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-10 19:05:10 UTC ---
The segfault is at the following line as expr==NULL:

5769      if (expr->ts.type == BT_DERIVED && expr->ts.u.derived

Backtrace:

#0  gfc_conv_expr (se=0x7fffffffcf40, expr=0x0) at
/projects/tob/gcc-git/gcc/gcc/fortran/trans-expr.c:5769
#1  0x0000000000630548 in gfc_conv_statement_function (se=0x7fffffffd0e0,
expr=<optimized out>) at
/projects/tob/gcc-git/gcc/gcc/fortran/trans-expr.c:5042
#2  gfc_conv_function_expr (se=0x7fffffffd0e0, expr=<optimized out>) at
/projects/tob/gcc-git/gcc/gcc/fortran/trans-expr.c:5102
#3  0x0000000000636314 in gfc_trans_assignment_1 (expr1=0x161c8a0,
expr2=0x161cd90, init_flag=<optimized out>, dealloc=<optimized out>)
    at /projects/tob/gcc-git/gcc/gcc/fortran/trans-expr.c:7203


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

* [Bug fortran/54223] Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls
  2012-08-10 14:21 [Bug fortran/54223] New: Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls roger.ferrer at bsc dot es
  2012-08-10 19:05 ` [Bug fortran/54223] " burnus at gcc dot gnu.org
@ 2014-01-05 13:01 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-01-05 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-05
     Ever confirmed|0                           |1
      Known to fail|4.8.0                       |4.8.2, 4.9.0

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at r206333.


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

end of thread, other threads:[~2014-01-05 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 14:21 [Bug fortran/54223] New: Statement function statement with dummy arguments that are also OPTIONAL may crash in wrong calls roger.ferrer at bsc dot es
2012-08-10 19:05 ` [Bug fortran/54223] " burnus at gcc dot gnu.org
2014-01-05 13:01 ` dominiq at lps dot ens.fr

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).