[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: gcc4 vs gcc3: a case (kerTeX)
On Wed, Mar 09, 2011 at 10:20:03AM -0800, Chuck Swiger wrote:
> On Mar 9, 2011, at 2:58 AM, tlaronde%polynum.com@localhost wrote:
> > For example when compiling kerTeX, the results were correct with gcc3.x
> > but with NetBSD now gcc4.1.3, the compilation went OK but METAFONT
> > (inimf(1)) was now unable to master some instructions (plain.mf).
> > It turns out that my CFLAGS were still specifying "-O2" and that the
> > result was a mess; while "-O" alone works. I suspect whether FPU
> > optimizations (while the D.E. Knuth's programs are integer based, mf(1)
> > does a lot of arithmetic (scaled integers) and perhaps some
> > optimizations shift to FPU while the code uses carefully structures
> > etc.), or some "volatile" that are optimized out.
> Does "-O2 -fno-strict-aliasing" work better?
> C99's type-punning assumptions (implied by -O2 in gcc-4.x including
> -fstrict-aliasing) aren't safe with older code which worked fine with prior
> versions of the compiler.
Thanks for the tip, but in this case no: it doesn't work.
This is a bit special in the case of TeX and al. since it is the
result of a translation of pseudo-Pascal (D.E.K. has used it almost
as an Algol to be able to translate) to ANSI C (C89) but I think
the result is too "smart" for an automatic edgy optimization.
Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C
Main Index |
Thread Index |