* Peter O'Gorman wrote on Tue, Dec 12, 2006 at 01:26:42PM CET:
There is a test to check the stack direction when building the
replacement alloca. This test returns bad results with optimizations:
[...]
exit (find_stack_direction () < 0);
Side note: a declaration for exit was not in place. Autoconf uses
return from main, now that it does not provide for such a declaration
any more (since 2.60).
It also fails with -xO2 on HPUX11.23/IA64. I realize that both these
platforms have alloca so the autoconf test will never be run, but am
wondering if any of the gurus on this list can come up with any ideas
for a working test with optimizations. The problem is, of course,
that
the compiler inlines everything when optimizing so the results are
not valid.
I think the ISO C answer is that a guaranteed working test is not
possible: you may not compare pointers to distinct objects.