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: [jwe@bevo.che.wisc.edu: Crashing after complex division by zero]


>Of course, that means that programs compiled with -Os do not perform the
>same computation as those compiled with other options.  I'm sorry I
>forgot to point that out.

Right.  I don't feel it's a serious problem.  The only sense in which
it's a regression is that g77 no longer exhibits "consistently bad"
behavior -- it's now usually pretty decent behavior.  (Depending, of
course, on how one views these things.)

However, it's enough of an issue that, someday, perhaps for GCC 3.0,
g77 should leave it to the gcc back end to make the `-Os' choice.
The back end could then handle things however it wanted -- ideally,
with more attention to numerical consistency, maybe with its own
complex-divide library routines (in libgcc.a or something like that).

Still, g77 users pretty much have to accept that g77 often makes choices
that are consistent with how f2c behaves, except when it doesn't.
They don't have to *like* it, of course...but it's quite unclear
in what direction g77 should head, and how fast it can get there.

>John Eaton's Octave example points out why this do-not-abort-on-complex-
>divide-by-zero can be useful (especially when coupled to "passing the
>buck up"):  Octave could deliver a meaningful message to the user,
>instead of dumping core itself; or it could enable a user program to
>receive the trap [I do not really know if that can be done in Octave's
>language - perhaps John can point that out].

Right, presumably, catching whatever signal sig_die produces would
at least offer some relief.  But at least compiling without `-Os'
offers a behavior that, I think, most users (or "OEMs", i.e. people
embedding g77 or g77-compiled code within their products) would prefer.

        tq vm, (burley)


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