Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Dec 2021 20:18:31 -0500
From:      "Kevin P. Neal" <kpn@neutralgood.org>
To:        Doug Hardie <bc979@lafn.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Fortran exceptions
Message-ID:  <YbVN5wxkeaz7ooBI@neutralgood.org>
In-Reply-To: <2A944692-2C5A-4AF0-9E26-34C2142C5E3E@lafn.org>
References:  <2A944692-2C5A-4AF0-9E26-34C2142C5E3E@lafn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 10, 2021 at 11:09:30PM -0800, Doug Hardie wrote:
> I have a fairly large fortran program that I am trying to run on flang.  It almost works, but I am sure there are a few typos in it.  I had to enter it by hand from a large listing.  When it encounters a STOP, it displays several ieee exception messages.  Unfortunately there is no way to identify where those occurred.  How can I get the runtime to stop when an exception occurs.  This is on FreeBSD 13.0 release with whatever flang is in the ports.

Is this compiling with optimization turned on or off?

The clang front end can be told that FP traps are expected, and it can be
told to preserve every single one of them. Normally clang assumes no FP
trap will ever happen. The result is that LLVM will reorder instructions
in ways that may be ... surprising.

I believe flang has the same assumption as clang, and I don't believe it
currently has a way to be told to expect FP traps.

But, if you compile with optimizations turned off then you avoid the issue
entirely. At least, I think flang will avoid it. I've been working on the
issue of FP traps in clang+llvm for nearly four years, but I haven't looked
at all at flang.

-- 
"A method for inducing cats to exercise consists of directing a beam of
invisible light produced by a hand-held laser apparatus onto the floor ...
in the vicinity of the cat, then moving the laser ... in an irregular way
fascinating to cats,..." -- US patent 5443036, "Method of exercising a cat"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YbVN5wxkeaz7ooBI>