bug-guile
[Top][All Lists]
Advanced

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

Re: guile-2.0.0 fails to build without threads


From: Andy Wingo
Subject: Re: guile-2.0.0 fails to build without threads
Date: Mon, 20 Jun 2011 10:06:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

On Fri 17 Jun 2011 12:25, Andy Wingo <address@hidden> writes:

> On Sat 21 May 2011 15:51, Marco Maggi <address@hidden> writes:
>
>> Andy Wingo wrote:
>>> Thanks.  You  seem to  be running on  system in  which the
>>> stack    grows   up.    Is    that   the    case?    Check
>>> libguile/scmconfig.h and config.log.
>>
>> Yes, I have:
>>
>> #define SCM_STACK_GROWS_UP 1 /* 0 or 1 */
>>
>> maybe the problem  is that GCC 4.6.0 with  -O3 optimises the
>> program in such a way that the test is invalidated.
>
> This bug is also present in Autoconf, where this test comes from
> originally.  I have reported it there.  I have no idea what kind of test
> can defeat such an omniscient inliner.

Fixed in git, for the time being.  It's an arms race with the compiler,
and clearly code clarity is losing:

  int
  find_stack_direction (int *addr, int depth)
  {
    int dir, dummy = 0;
    if (! addr)
      addr = &dummy;
    *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
    dir = depth ? find_stack_direction (addr, depth - 1) : 0;
    return dir + dummy;
  }

  int
  main (int argc, char **argv)
  {
    return find_stack_direction (0, argc + !argv + 20) < 0;
  }

See
http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00032.html.

Andy
-- 
http://wingolog.org/



reply via email to

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