From owner-freebsd-questions@FreeBSD.ORG Sat Sep 11 09:28:34 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4998106566B for ; Sat, 11 Sep 2010 09:28:34 +0000 (UTC) (envelope-from ohartman@mail.zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by mx1.freebsd.org (Postfix) with ESMTP id 9001D8FC0C for ; Sat, 11 Sep 2010 09:28:34 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.69) for freebsd-questions@freebsd.org with esmtp (envelope-from ) id <1OuMNt-0006KW-F4>; Sat, 11 Sep 2010 11:28:33 +0200 Received: from e178019247.adsl.alicedsl.de ([85.178.19.247] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.69) for freebsd-questions@freebsd.org with esmtpsa (envelope-from ) id <1OuMNt-00007q-7R>; Sat, 11 Sep 2010 11:28:33 +0200 Message-ID: <4C8B4BC0.1000900@mail.zedat.fu-berlin.de> Date: Sat, 11 Sep 2010 11:28:32 +0200 From: "O. Hartmann" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100908 Thunderbird/3.1.3 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: 85.178.19.247 Subject: Compiling software with different compiler than cc or clang results in unusable output X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2010 09:28:34 -0000 Dear Sirs, you see me a kind of desperate. I wrote my own a small piece of software in C, calculating the orbit and position of astronomical objects, astroids, in a heliocentric coordinate system from Keplerian orbital elements. So far. The software calculates the set of points of an ellipse based upon ephemeridal datas taken from the Minor Planet Cataloge. Again, so far, everything all right. The set of points of an orbit is all right and correct. But when it comes to positions at a specific time, then I loose hair! Compiling this piece of software with FreeBSD's gcc (V4.2) and clang (clang devel) on my private and lab's FreeBSD boxes (both most recent FreeBSD 8.1/amd64), this program does well, the calculated orbital positions are very close to professional applications or observational checks. But when compiling the sources with gcc44 or gcc45 (same source, same CFLAG setting, mostly no CFLAGS set), then there is a great discrepancy. Sometimes when plotting positions, the results plotted seconds before differs from the most recent. The ellipses are allways correct, but the position of a single point at a specific time isn't correct. I use the GNU autotools to build the package. I suspekt miscompilations in memory alloction or in some time- or mathematical functions like sin, cos. before I digg deeper I'd like to ask the community for some hints how to hunt down such a problem. regards, Oliver