Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-03 Thread Martijn van Oosterhout
On Mon, Aug 02, 2010 at 05:34:57PM +0100, Greg Stark wrote: Tom: Because that code is much more complex and prone to errors especially when you start getting into multiplication and other operations and it's also much slower than the code which allows overflow to happen and then checks that

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-02 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: FWIW, I think we should aim to eventually remove the dependency on -fwrapv, and instead make the code correct under the semantics guaranteed by the C spec. [ shrug... ] We've gone around on that before. I can't get excited about it, and the reason is

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-02 Thread Greg Stark
On Mon, Aug 2, 2010 at 4:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: Here's the problem: if the compiler is allowed to assume that overflow cannot happen, it is always going to be able to prove that the if-test is constant false.  This is inherent.  Anybody claiming to exhibit a safe way to code

[HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Neil Conway
I tried $subject recently, and noticed some minor issues: (1) Two warnings that suggest bugs; in src/backend/utils/adt, datetime.c:3101:27: warning: use of logical || with constant operand; switch to bitwise | or remove constant And similarly for src/interfaces/ecpg/pgtypeslib/interval.c.

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: I tried $subject recently, and noticed some minor issues: (1) Two warnings that suggest bugs; in src/backend/utils/adt, datetime.c:3101:27: warning: use of logical || with constant operand; switch to bitwise | or remove constant And similarly for

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: *** src/backend/utils/adt/datetime.c 9 May 2010 02:15:59 - 1.212 --- src/backend/utils/adt/datetime.c 1 Aug 2010 23:09:30 - *** *** 3098,3104 break;

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: I tried $subject recently, and noticed some minor issues: I tried to duplicate your results using what I believe to be the latest version of clang, $ clang -v Apple clang version 1.5 (tags/Apple/clang-60) Target: x86_64-apple-darwin10 Thread model:

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: (As an aside, is no-cpp-precomp still necessary for reasonably-modern versions of Apple GCC?) I looked into this point a little bit. Apple abandoned their nonstandard precompiler as of gcc 3.3, so the switch is a no-op in that version and later, as per

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Neil Conway
On Sun, Aug 1, 2010 at 7:40 PM, Tom Lane t...@sss.pgh.pa.us wrote: I tried to duplicate your results using what I believe to be the latest version of clang, I'm using SVN tip of llvm+clang from ~one week ago. (2) clang doesn't support (or require) -no-cpp-precomp, which src/template/darwin

Re: [HACKERS] Compiling CVS HEAD with clang under OSX

2010-08-01 Thread Neil Conway
On Sun, Aug 1, 2010 at 9:40 PM, Tom Lane t...@sss.pgh.pa.us wrote: I'm still wondering about the bleats I saw for -fwrapv though. configure already is set up to install that switch only conditionally:  # Disable optimizations that assume no overflow; needed for gcc 4.3+