On Dec 13, 2006, at 9:48 PM, Ralf Wildenhues wrote:
Hi Peter,
Hi Ralf,
* 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).
Yeah, sorry, I cut & pasted from an older autoconf. The basic problem
is still there though in _AC_LIBOBJ_ALLOCA the only difference is the
return instead of exit :)
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.
That's what I was afraid of.
Could you do me a favor and add a comment to the test -
/* Danger Danger - invalid with optimizations - what are you trying
to do? */
Or something similar. There is, I am told, another copy of the test
in mozilla, might be best to warn people that they may not get the
results they expect when they copy and paste this autoconf test.
Thanks,
Peter
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf