GCC Status Report (2004-03-09)
Jakub Jelinek
jakub@redhat.com
Thu Mar 11 12:48:00 GMT 2004
On Thu, Mar 11, 2004 at 10:52:44AM +0100, Eric Botcazou wrote:
> So we may end up with a record that contains some read-only fields, has been
> wholly cleared and is indirectly assigned. In this case again, we have a
> memory write without the /u flag followed by a memory write with the /u
> flag. Richard Kenner fixed that on the 3.4 branch *before* Jakub's patch by
> putting the /u flag during the clearing optimization in store_constructor:
But I've reverted my patch on 3.4 branch and the trunk (after changing
i386 backend to honor /u in stringops).
BTW, there is one optimization which we perhaps could do. People often
write:
void foo (void)
{
const char bar[16] = { 0x80 };
baz (bar);
}
which could be optimized into:
void foo (void)
{
static const char bar[16] = { 0x80 };
baz (bar);
}
Then we can get rid of the runtime initialization altogether.
This could be done either if the whole aggregate is const, or if all fields
are const.
Jakub
More information about the Gcc
mailing list