Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Apr 2001 12:59:29 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        stable@FreeBSD.ORG
Subject:   Re: Trouble with 4.3-RELEASE compiler
Message-ID:  <20010428125928.A5681@student.uu.se>
In-Reply-To: <20010428093802.59828860.steveo@eircom.net>; from steveo@eircom.net on Sat, Apr 28, 2001 at 09:38:02AM %2B0200
References:  <20010427194022.A18639@roma.coe.ufrj.br> <200104280127330789.011EEEF5@tensor.xs4all.nl> <20010428093802.59828860.steveo@eircom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 28, 2001 at 09:38:02AM +0200, Steve O'Hara-Smith wrote:
> On Sat, 28 Apr 2001 01:27:33 +0200
> "Dimitry Andric" <dim@xs4all.nl> wrote:
> 
> DA> Squid with gcc 2.95.2 and optimization (both -O, -O2 and -O666), and
> DA> I can assure you it bombed out with inexplicable null pointer
> DA> accesses. Yet when you compile with -O0, no such thing happens...
> 
> 	I have been working getting swish++ set up as a port (4.3-STABLE) and
> I've found that the search program only works if compiled with no -O setting,
> -O3 (the original) and -O cause segmentation violation, while -O2 gave an
> illegal instruction trap. The index program OTOH appears to work with all
> optimisations settings.
> 
> 	It makes me wonder just how safe -O is :(
> 

Although it is quite possible that gcc generates incorrect code in some
cases when invoked with -O it is not very likely.
I would say that it is much more likely that the code which is being
compiled contains a bug that is exposed by the optimization and that the
code just happens to work when comiled with -O0.

Generally I would say that -O is *safer* than -O0 for the simple reason
that it is used more and therefore gets more testing.



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010428125928.A5681>