Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: flconseil(at)yahoo(dot)fr
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol
Date: 2006-01-11 20:49:44
Message-ID: 28007.1137012584@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"F. Laupretre" <flconseil(at)yahoo(dot)fr> writes:
> When configure checks to see if we have finite(), it attempts to
> compile a small program containing 'dummy=finite(1.0)'. On my system,
> where I am using gcc 4.0.2, this small program is tested with a '-O2'
> flag, and the gcc optimizer is too smart ! It detects that we are
> writing to a dummy var, and it removes the line !

Argh! gcc couldn't do that in general, of course --- it must be using
some built-in knowledge that finite() doesn't have side-effects.
I'll have to look at how AC_CHECK_FUNC() avoids that. Obviously we
are getting bit because our homegrown check for finite() isn't smart
enough.

I'd actually argue that this is a gcc bug: when there is no declaration
of finite() in the system headers (there isn't is there?) it's wrong to
conclude just on the name of the function that it is side-effect-free.
But I don't suppose a fix will be forthcoming quickly, so we'll have to
work around it.

Thanks for taking the trouble to chase this down.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-01-11 21:01:44 Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol
Previous Message F. Laupretre 2006-01-11 20:42:09 Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol