[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Over-aggressive Optimizations with gcc 4.1.1
From: |
Waldek Hebisch |
Subject: |
Re: [Gm2] Over-aggressive Optimizations with gcc 4.1.1 |
Date: |
Thu, 26 Oct 2006 11:55:50 +0200 (CEST) |
Gaius Mulley wote:
> John O Goyo <address@hidden> writes:
<snip>
> > gcc-4.1.1-32: tst=> gm2 -S -I. -O2 add.mod
> > gcc-4.1.1-32: tst=> cat add.s
> > .file "add.mod"
> > .ident "GCC: (GNU) 4.1.1"
> > gcc-4.1.1-32: tst=>
> >
> > Hhhmm..... #6-)
> > john
>
> Hi John,
>
> thanks for the report - yes gm2 does perform some rather optimistic
> transformations.. looks like we need another set of regression tests
> which perform -O2 and a link and run.
>
Do you mean that gm2 frontend mis-optimizes the code. For Pascal I
found out that 4.x backend has quite aggresive removal of "unused" code.
At -O2 and -O3 cgraph routines start from known external entries
and mark reachable objects. Everything unreachable is removed.
I had to make sure that backend knows about all exported functions
(otherwise it removed them): I do not remember exactly what I did,
but I think it is enough to make sure that your declaration is
on the list returned by getdecls and has proper bits set (TREE_PUBLIC
and TREE_STATIC).
--
Waldek Hebisch
address@hidden