Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jan 2000 10:09:09 +0100
From:      Martin Cracauer <cracauer@cons.org>
To:        mauzi@poli.hu
Cc:        hackers@FreeBSD.ORG
Subject:   Re: [OFFTOPIC] alt. C compiler
Message-ID:  <20000105100909.B63545@cons.org>
In-Reply-To: <Pine.BSF.4.21.0001041924200.30369-100000@aquarius.poli.hu>; from Gergely EGERVARY on Tue, Jan 04, 2000 at 07:32:13PM %2B0100
References:  <Pine.BSF.4.21.0001041924200.30369-100000@aquarius.poli.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
In <Pine.BSF.4.21.0001041924200.30369-100000@aquarius.poli.hu>, Gergely EGERVARY wrote: 

> I have just upgraded my system to -current w/egcs 2.95.2 and I have
> several problems with it, especially when using optimizations (-O2 and
> such)

When your code breaks when using -O2 or higher, don't do that, use
just -O!

Almost all examples I've seen where people claimed newer gcc's broke
their code are triggered by unclean C code that isn't strictly ANSI C
conformant (also see the other thread about ieeefp and floating point
exceptions).

As far as I understand, the gcc people try to keep the -O option
compatible in a way that it doesn't break code that didn't break in
earlier versions of gcc. This is exactly the option you need, it's a
service for you and you should use it unless you are absolutely sure
your code is valid.

There are examples of -O2 or higher breaking valid code, but they are
much less common than implied. And such issues were in 2.7.x was well,
that's the reason the base system is compiled with -O.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany     http://www.bsdhh.org/


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




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