Patch for uninitialized structures in tests

Olga Golovanevsky OLGA@il.ibm.com
Sun Apr 27 16:30:00 GMT 2008


gcc-patches-owner@gcc.gnu.org wrote on 24/04/2008 21:57:03:

> > The tests are legal C code programs. They do not depend on
> > the initialization values. As I understand, they get
> > into abort () because the comparisons p[i].a != p[i].b + 1
> > returns true.
>
> They do depend on the initialization values for the following reason.
> The tests are doing floating point comparisons.  p[i].a != p[i].b
> returning true is exactly what is expected if p[i].a and p[i].b are
> nan values.  The comparison a != a is one way to test for a floating
> point nan.  If the initialization values contained a signalling nan,
> the arithmetic operation would generate an exception using the default
> runtime settings under hpux.


I see your point.

Are the tests getting into exception on comparison on hpux, and not into
abort () explicitly written in the tests?

>
> > In addition, these tests pass on hpux,
> > when run without -fipa-struct-reorg flag.
>
> The tests pass in this case because there is only one malloc call
> and the initial values returned from this call are all zero.].

It is exactly what I want to know.

With -fipa-struct-reorg flag, the initial malloc is replaced with
two malloc calls generated by struct-reorg optimization. They should
call the same malloc function as the original one, only parameters
are different. If these calls have different function declarations, or
there is something special generated for hpux platform, this optimization
should be aware of it, and reproduce it to be the same as original malloc
call. For example, I wonder why original malloc is zeroed, and optimization
generated one is not.

Olga




More information about the Gcc-patches mailing list