public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dick dot hendrickson at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/35756] New: incorrect WHERE for functions in ELSEWHERE and overlaps Date: Sat, 29 Mar 2008 15:38:00 -0000 [thread overview] Message-ID: <bug-35756-15620@http.gcc.gnu.org/bugzilla/> (raw) The following program computes the wrong values for the even (elsewhere branch) of the left hand array. It looks like the function R_MY_MIN_I is evaluated before the store in the WHERE branch happens. The same thing happens if the R_M* functions are external rather than contained. Dick Hendrickson program RA1028 ! fails on Windows XP ! gcc version 4.4.0 20080312 (experimental) [trunk revision 133139] INTEGER ILA(10) LOGICAL LDA(10) ILA = (/ (I, i=1,10) /) LDA = (/ (i/2*2 .ne. I, i=1,10) /) WHERE(LDA) ILA = R_MY_MAX_I(ILA) ELSEWHERE ILA = R_MY_MIN_I(ILA) ENDWHERE print *, 10,2,10,2, ' etc' !expected print *, ila CONTAINS INTEGER FUNCTION R_MY_MAX_I(A) INTEGER :: A(:) R_MY_MAX_I = MAXVAL(A) END FUNCTION R_MY_MAX_I !internal procedure INTEGER FUNCTION R_MY_MIN_I(A) INTEGER :: A(:) R_MY_MIN_I = MINVAL(A) END FUNCTION R_MY_MIN_I !internal procedure END C:\g_experiments\gfortran>gfortran ra1028.f C:\g_experiments\gfortran>a 10 2 10 2 etc 10 1 10 1 10 1 10 1 10 1 -- Summary: incorrect WHERE for functions in ELSEWHERE and overlaps Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dick dot hendrickson at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35756
next reply other threads:[~2008-03-29 15:38 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-03-29 15:38 dick dot hendrickson at gmail dot com [this message] 2008-03-29 15:52 ` [Bug fortran/35756] " burnus at gcc dot gnu dot org 2008-03-31 20:37 ` pault at gcc dot gnu dot org 2008-05-16 21:13 ` pault at gcc dot gnu dot org 2008-05-17 7:12 ` pault at gcc dot gnu dot org 2008-05-17 7:17 ` pault at gcc dot gnu dot org
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-35756-15620@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).