Unix Technical Forum

BUG #2740: gcc bug on intel mac with postgresql -O3 optimized build

This is a discussion on BUG #2740: gcc bug on intel mac with postgresql -O3 optimized build within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2740 Logged by: Alon Goldshuv Email address: agoldshuv@greenplum.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:21 AM
Alon Goldshuv
 
Posts: n/a
Default BUG #2740: gcc bug on intel mac with postgresql -O3 optimized build


The following bug has been logged online:

Bug reference: 2740
Logged by: Alon Goldshuv
Email address: agoldshuv@greenplum.com
PostgreSQL version: 8.1.5
Operating system: Mac OSX intel
Description: gcc bug on intel mac with postgresql -O3 optimized build
Details:

I don't know if this is a known issue already and was reported previously.
This is a gcc bug, and *not a postgresql bug*, but it affects query results
and should be of interest to intel mac pg users.

Regression tests showed wrong output for a query in the 'select_views' test
*only on intel mac*. Query is: SELECT * FROM street ORDER BY 1. We narrowed
it down to the '?#' operator which returns wrong results (in the 'street'
view it is actually a user defined 'path ## path' operator that is based on
the 'path ?# path' logic).

A simple way to reproduce without creating tables and running multi row
result queries is the following 1 line statement:

select path '((-122.1,37.3),(-122.2,37.5),(-122,37.5))' ?# path
'((-122.1697,37.375),(-122.1681,37.383))';

This statement should always return 'false'. However on the tested intel mac
platform it returned 'true'.

We ended up tracing it all the way to gcc. Turns out that the gcc version we
were using had a bug in one of the optimization flags that get included with
-O3, i believe it was function inlining. When compiling with -O2 or lower
the query would return the correct result.

We upgraded the xcode tools version with the latest - Xcode 2.4.1 released
31Oct2006, and that fixed the bug.

compiler with -O3 bug:
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5250)

updated bug free gcc:
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)

regards,
Alon.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com