dbTalk Databases Forums  

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

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2740: gcc bug on intel mac with postgresql -O3 optimized build in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alon Goldshuv
 
Posts: n/a

Default [BUGS] BUG #2740: gcc bug on intel mac with postgresql -O3 optimized build - 11-06-2006 , 12:00 PM







The following bug has been logged online:

Bug reference: 2740
Logged by: Alon Goldshuv
Email address: agoldshuv (AT) greenplum (DOT) 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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.