initialized out.clauses in read_predicate

Alexandre Oliva
Tue Jun 7 06:19:00 GMT 2011

On Jun  6, 2011, Jan Hubicka <> wrote:

>> On May 30, 2011, Alexandre Oliva <> wrote:
>> > Index: gcc/ipa-inline-analysis.c

> Well, clauses is a typical zero terminated array, so I really do think
> the warning is bogus.

Looking into it, I'm not sure it is.  Compiling with -O3 I get:

ipa-inline-analysis.c: In function ‘inline_read_summary’:
ipa-inline-analysis.c:531:22: warning: ‘out.clause[8]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ipa-inline-analysis.c:2294:20: note: ‘out.clause[8]’ was declared here

> Do you at least know why we end up with that weird warning?

531:      *es->predicate = *predicate;

This is clearly copying all fields and array members, even the
uninitialized ones.  However, like padding copied while copying structs,
I'm not sure that's a problem if the copied members are not accessed.
However, it is absolutely correct that we are copying uninitialized data

Alexandre Oliva, freedom fighter
You must be the change you wish to see in the world. -- Gandhi
Be Free! --   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

More information about the Gcc-patches mailing list