This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: g77 3.4.(2|3): Failure when calling gcc 3.4.(2|3) functions
Gotcha... thanks for the info! Again, keep up the great work.
- Sam
On Mon, 2004-11-22 at 16:13 -0800, Tim Prince wrote:
> At 03:46 PM 11/22/2004, Samuel Ziegler wrote:
>
> >The semantic change seems to deal with the short-circuiting of if
> >statements. The G77 3.4.x behavior appears to be correct. According to
> >this document:
> >http://www.ibiblio.org/pub/languages/fortran/ch1-8.html
> >
> >I poked through the release notes, but didn't see anything about this
> >change. Does this describe a change which occurred?
> >
> >Here is a test program from my coworker:
> >
> >g77 -fno-underscoring -g -fugly-logint fort2.f -o testcase
> >
> >------fort2.f-------------------------
> >
> > integer function child()
> > write (*, *) 'Gahh'
> > child = 1
> > end
> >
> > subroutine parent
> > integer a
> > integer child
> >
> > a = 0
> >
> >c Is the second expression evaluated ?
> >c G77 3.3 - Says no
> >c G77 3.4 - Says yes
> > if(a.eq.1.and.child().eq.1) then
> >c do nothing
> > endif
> >
> > return
> > end
> >
> >
> > program testcase
> > call parent
> > end
> >
> >-------- end fort2.f ---------------------
>
> As your example shows, if you depend on undefined behavior, a change in the
> back end could change your results, even though no change was likely to
> have been made specifically to g77.
>
>
> Tim Prince
>
>
> !DSPAM:41a280b8117305892876448!
>