public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kloedej at knmi dot nl" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47569] New: gfortran does not detect that the parameters for passing a partial string to a subroutine are incorrect. Date: Tue, 01 Feb 2011 10:40:00 -0000 [thread overview] Message-ID: <bug-47569-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47569 Summary: gfortran does not detect that the parameters for passing a partial string to a subroutine are incorrect. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: kloedej@knmi.nl gfortran does not detect that the parameters for passing a partial string to a subroutine are incorrect. The example uses s(i) in stead of s(i:j) to pass the string, and this was a common usage pattern in the old fortran77 days, so this may bother more users. Sample code: module teststr implicit none integer, parameter :: GRH_SIZE = 20, NMAX = 41624 type strtype integer :: size character :: mdr(NMAX) end type strtype contains subroutine sub2(string,str_size) integer,intent(in) :: str_size character,intent(out) :: string(str_size) string(:) = 'a' end subroutine sub2 subroutine sub1(a) type(strtype),intent(inout) :: a call sub2(a%mdr(GRH_SIZE+1),a%size-GRH_SIZE) end subroutine sub1 end module teststr Command used for compiling: >gfortran -c minimal_example.F90 f951: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. > gfortran version used: >gfortran --version GNU Fortran (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) If the line: call sub2(a%mdr(GRH_SIZE+1),a%size-GRH_SIZE) is replaced by: call sub2(a%mdr(GRH_SIZE+1:),a%size-GRH_SIZE) then the compilation runs without problems. Expected output was to get a proper error message with the provided sample code.
next reply other threads:[~2011-02-01 10:40 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-02-01 10:40 kloedej at knmi dot nl [this message] 2011-02-01 11:04 ` [Bug fortran/47569] [4.3/4.4/4.5/4.6 Regression] " burnus at gcc dot gnu.org 2011-02-01 11:33 ` burnus at gcc dot gnu.org 2011-02-01 14:54 ` burnus at gcc dot gnu.org 2011-02-01 15:19 ` burnus at gcc dot gnu.org 2011-02-03 5:27 ` pault at gcc dot gnu.org 2011-02-03 7:46 ` burnus at gcc dot gnu.org 2011-02-10 15:14 ` burnus at gcc dot gnu.org 2011-02-10 15:21 ` burnus at gcc dot gnu.org 2011-02-12 1:38 ` burnus at gcc dot gnu.org 2011-02-12 19:24 ` dominiq at lps dot ens.fr 2011-02-12 19:28 ` burnus at gcc dot gnu.org 2011-02-13 10:14 ` burnus at gcc dot gnu.org 2011-02-13 19:30 ` burnus at gcc dot gnu.org 2011-02-13 21:01 ` [Bug fortran/47569] [4.3/4.4/4.5 " burnus at gcc dot gnu.org 2011-02-14 8:04 ` burnus at gcc dot gnu.org 2011-02-14 14:07 ` [Bug fortran/47569] [4.3/4.4 " burnus at gcc dot gnu.org 2011-02-14 14:12 ` [Bug fortran/47569] [4.3/4.4/4.5/4.6 " burnus at gcc dot gnu.org 2011-02-14 14:13 ` kloedej at knmi dot nl
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-47569-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).