X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7BFD388C00D
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=towo.net
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo@towo.net
Subject: Re: stack grow direction wrongly detected
To: cygwin@cygwin.com
References: <6eded5d3-93f3-7c98-5055-ee5ac2566bc8@gmail.com>
 <20210305233104.782838da83161a90f56a5369@nifty.ne.jp>
 <YEJDjnDYbV7RXsqw@xps13> <6dd2f48b-89d6-ce58-c8c1-bb8a351128c2@gmail.com>
From: Thomas Wolff <towo@towo.net>
Message-ID: <0162d7c3-54a4-3ecd-f6d5-b568ec1d9402@towo.net>
Date: Sat, 6 Mar 2021 10:29:01 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
 Thunderbird/78.8.0
MIME-Version: 1.0
In-Reply-To: <6dd2f48b-89d6-ce58-c8c1-bb8a351128c2@gmail.com>
X-Provags-ID: V03:K1:DaRZ8v35xCSiXuhC+BKZ0RLkOzh7nyMY4WBLVZXX0BMpPsfuI/T
 UknK8g2+eUAdYCWeceXIzmjdyjlt5sVP4J0VzzzzNKeFz9iuv6DD1v5bCRaCOMrMAw03eNy
 wTLLY8m8R2pvFoDcGwbU1+obSHxpPJZhchAscAj7SytCQHvYMq/afCFSnTSPwpw2awOlTqE
 8GYTBw7gtV/CGP2cxiH+g==
X-UI-Out-Filterresults: notjunk:1;V03:K0:fQx2dBZOGvk=:jTO316cfCoCA2irl6P/tRn
 n94X44MS9aBqzhiC79w5HihAxCO6UuUShTQBCOAFMlT899PIjJ70ORb6/p/1ibEgeygTLji6U
 LkrHzjKtGJUeu8Mb/QMNcIYtqgFAg9fKGrn8Yn3umN5YFSf+R59tgrbiGR5cqy9JAPXR8SnaK
 +jkQmrMJsv7pA55XB1BD0Y6sEU075q2/wnFXWH458me0Te/N/om0GLadpMi4SA/8Zsst759oy
 dNxuk7soYK3DfM+CJN47NG4mwHayGKZQXHogm5BZLt7ieMG28pVQF7vprl4lDwRDVqT+jOBQm
 QewIi6bXpHAhY4WMq9RDWvNaTM/lFIBGM3HNfmzMmFUgVY3J9hxP2vMpP4Y5C1DefmhkcAPNm
 oeGZoGHW5LKAdIPRs6GgL3Pk4QdmUvLNW/3R0aC90XPgXxGMw8LFSmjiuH/F9
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,
 SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>


Am 06.03.2021 um 09:29 schrieb Marco Atzeri via Cygwin:
> On 05.03.2021 15:43, gs-cygwin.com@gluelogic.com wrote:
>> On Fri, Mar 05, 2021 at 11:31:04PM +0900, Takashi Yano via Cygwin wrote:
>>> On Fri, 5 Mar 2021 13:18:38 +0100
>>> Marco Atzeri wrote:
>>>> Hi Guys,
>>>> noted trying to rebuild guile 1.8.8.
>>>>
>>>> The following piece of code in the past
>>>> was setting SCM_I_GSC_STACK_GROWS_UP=0
>>>> and now produces SCM_I_GSC_STACK_GROWS_UP=1
>>>>
>>>> I assume some change in the gcc compiler is causing the issue.
>>>> I presume most of the programs and libraries do not care,
>>>> but some special one like guile crashes during build for this issue,
>>>> so be aware.
>>>>
>>>> Regards
>>>> Marco
>>>>
>
>>
>> If the compiler is gcc or clang:
>>
>> __attribute__(__noinline__)
>
> thanks Glenn,
>
> as
> __attribute__((__noinline__))
>
> it seems to work
> for all variant of -Ox
>
>> int
>> find_stack_direction ()
>> {
>> ...
>> }
>>
>> Cheers, Glenn
Can somebody explain the weird behaviour previously described, address 
of the char going up 1 byte a few times, then skipping down, etc, and 
why recursive calls are affected at all by inline, and what gcc thinks 
it can optimize in that case?
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
