[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in check for stack growth direction in _AC_LIBOBJ_ALLOCA

From: Andrew W. Nosenko
Subject: Re: bug in check for stack growth direction in _AC_LIBOBJ_ALLOCA
Date: Mon, 20 Jun 2011 11:25:44 +0300

On Sun, Jun 19, 2011 at 22:03, Andy Wingo <address@hidden> wrote:
> Hi,
> On Sat 18 Jun 2011 22:25, "Andrew W. Nosenko" <address@hidden> writes:
>> On Fri, Jun 17, 2011 at 13:21, Andy Wingo <address@hidden> wrote:
>>> address@hidden:/tmp$ cat foo.c
>>>  int
>>>  find_stack_direction ()
>>>  {
>>>    static char *addr = 0;
>> Try to rewrite this line as
>>         volatile static char *addr = 0;
>> It should help.
> It didn't, unfortunately.

You are right.  I marked the underlying char as volatile instead of
the pointer itself.
The proper version seems
    static char* volatile addr;
but ATM I have no compiler around for verify that.

Hope, in 3-4 hours I will have ability to verify my guess and have
proper verified results.

> This issue can be reproduced on a stock Debian unstable system with
> gcc-4.6, btw.
>>> I don't know what allows GCC to do this inlining.  Could it be a GCC
>>> bug?  Every time I think I have a GCC bug I'm wrong, though :)
>> No.  It indeed traceable.  Just start from main() and you will have
>> full trace even with pen and paper.
> Apologies for the ignorant question, but what does "trace" mean? :)

"Trace" means that you may "a priory" trace/predict the whole control
flow without actual running the code.  Therefore, highly optimizing
compiler may reduce whole function call to the simple constant.  From
your description, Gcc occur smart enough for remove the recursion but
not enough for simplify to the simple constant.

Andrew W. Nosenko <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]