From owner-freebsd-stable Fri Apr 27 23:59:26 2001 Delivered-To: freebsd-stable@freebsd.org Received: from roma.coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65]) by hub.freebsd.org (Postfix) with ESMTP id B3D1B37B423 for ; Fri, 27 Apr 2001 23:59:21 -0700 (PDT) (envelope-from jonny@jonny.eng.br) Received: (from uucp@localhost) by roma.coe.ufrj.br (8.11.3/8.11.3) id f3S6xBD02461; Sat, 28 Apr 2001 03:59:11 -0300 (BRT) (envelope-from jonny@jonny.eng.br) Received: from localhost.coe.ufrj.br(127.0.0.1), claiming to be "jonny.eng.br" via SMTP by localhost.coe.ufrj.br, id smtpdWfisKj; Sat Apr 28 03:59:01 2001 Message-ID: <3AEA6A44.8936FF61@jonny.eng.br> Date: Sat, 28 Apr 2001 03:59:16 -0300 From: Joao Carlos Mendes Luis Organization: Internet via Embratel X-Mailer: Mozilla 4.75 [en] (Win95; U) X-Accept-Language: pt-BR,pt,en MIME-Version: 1.0 To: Dimitry Andric Cc: stable@FreeBSD.ORG, "=?iso-8859-1?Q?Jo=E3o?= Carlos Mendes =?iso-8859-1?Q?Lu=EDs?=" Subject: Re: Trouble with 4.3-RELEASE compiler References: <20010427194022.A18639@roma.coe.ufrj.br> <200104280127330789.011EEEF5@tensor.xs4all.nl> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dimitry Andric wrote: > On 2001-04-27 at 19:40 Joao Carlos Mendes Luis wrote: > > I was installing a squid server with 4.3-RELEASE, and found that > >FreeBSD has now a bug in the compiler that affects squid. The > >default compilation of squid is with CFLAGS=-g -O2 -Wall, and this > >setup > >triggers the bug. > > This is a fragment from the Squid configure file (from the original > 2.4-STABLE1 distribution): > > # Remove optimization for GCC 2.95.[12] > # gcc -O[2] on *BSD and Linux (x86) causes pointers to magically > become NULL > if test "$GCC" = "yes"; then > GCCVER=`$CC -v 2>&1 | awk '$2 == "version" {print $3}'` > case "$GCCVER" in > 2.95.[12]) > echo "Removing -O for gcc on $host with GCC $GCCVER" > CFLAGS="`echo $CFLAGS | sed -e 's/-O[0-9]*//'`" > ;; > esac > fi > > This was probably written before gcc 2.95.3 got out, but I'm not sure > if that version fixed the problem. I have foolishly tried to compile > Squid with gcc 2.95.2 and optimization (both -O, -O2 and -O666), and > I can assure you it bombed out with inexplicable null pointer > accesses. Yet when you compile with -O0, no such thing happens... That's it! I did not notice that -O2 was not inserted when using gcc 2.95.2. Thanks a lot! Jonny -- João Carlos Mendes Luís jonny@embratel.net.br Networking Engineer jonny@jonny.eng.br Internet via Embratel jcml@ieee.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message