This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug with g77 and -mieee on Alpha Linux


Quoting craig@jcb-sc.com (craig@jcb-sc.com):
> >Perhaps i have done something wrong, but i thought, -mieee should 
> >prevent these FPE's from occuring?
> 
> I don't know, it might/should, though I don't know offhand what the
> FP value you're trying to print actually is.  (It seems unlikely to
> be a signaling NaN, but, if that *was* what you're trying to print,
> I could understand why you got an FPE.)
The value is 1.448625e-313.

> There are two things that might be working, together or separately, to
> give you trouble:
> 
>   1.  You're supplying your own main(), but not running the libg2c
>       initialization code libg2c's main() normally runs.  See the
>       g77 docs for more info.  (Though in your example you wouldn't
>       need to call the routine to set up command-line info, you might
>       in the product code from which you derived the example.  And,
>       in both examples, setting up the signal stuff might be necessary.)
That's not the case (i changed that with no success).

> 
>   2.  You're using libg2c to print the FP value, but libg2c *itself*
>       has (presumably) not been compiled with -mieee.
This must be the reason. It has problems with 
'if(n<0)' in lwrite.c: l_g. Here it generates an FPE.

So i ask you to incorporate -mieee into the flags for libg2c.

>       I had assumed (erroneously, as I recently discovered) that gcc
>       automatically used multilibs to produce -mieee-compiled libraries
>       for Alpha targets, because, without that, libraries can crash (and
>       libg2c apparently *will* crash doing, e.g., output of floating-point
>       values that require -mieee).
> 
>   3.  You're not supplying `-mieee' when linking the object files, so
>       even if there *was* a libg2c.a built with -mieee available (and
>       properly configured, whatever that means), you'd pick up the default
>       one and, if #2 is correct, crash anyway.
This didn't make any difference, either.

> My own opinion is that this sort of thing is insanely painful to deal with,
> and that the default should have been -mieee all along (both for gcc and
> for Digital's compilers, but I assume the latter have all-along offered
> easier ways to get the -mieee behavior), with an option (-mno-ieee) being
> needed to get -mno-ieee performance.
I have to agree heavily on that.

Thanks,
Martin.

-- 
Your mouse has moved, Windows must be restarted for changes
to take affect - restart now?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]