Subject: Re: gcc-3.4 optimization kills "link sets"
To: None <firstname.lastname@example.org>
From: Christos Zoulas <email@example.com>
Date: 06/07/2004 17:59:00
In article <200406071643.SAA0000044858@zel459.zel.kfa-juelich.de>,
Matthias Drochner <M.Drochner@fz-juelich.de> wrote:
>Trying to build a kernel with gcc-3.4 I've found that the
>optimisation settings of the current default kernel Makefile
>cause unreferenced static variables to be optimized away,
>regardless of an __attribute__((unused)).
>This breaks the "link set" way of initializing arrays of
>things which are scattered around.
>Rather than introducing dummy references to trick gcc into
>keeping definitions in it would look cleaner to just make
>these definitions global -- see the appended patch.
>Are ther any possible conflicts or side-effects?
Well, there is the "used" attribute that we should probably be using...
Reading the documentation, both "used" and "unused" attributes
affect only functions.