X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC499385802E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=towo.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo.net Subject: Re: gcc 11 weird bug To: cygwin AT cygwin DOT com References: <248361fa-f16d-cebb-eefe-be78e09f4c10 AT towo DOT net> <530117425 DOT 2623944 DOT 1635332143429 AT mail DOT yahoo DOT com> <61db07a8-e4d2-c1f1-83ca-5ba1c2a21317 AT towo DOT net> From: Thomas Wolff Message-ID: <458d4405-1c8e-d2f3-3fd9-ce10c307587c@towo.net> Date: Wed, 27 Oct 2021 20:54:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <61db07a8-e4d2-c1f1-83ca-5ba1c2a21317@towo.net> X-Provags-ID: V03:K1:jJ+TS4zJUhAJDSQpxCQLnjXsh7hfaR8PC5/fv51Om9liUvCTvj9 hptlpvDUOb4kXny2Z4lIcCZsMLZhIlwyF50Qiz6P2gU+VS93XRv382kJUm8N3EqhlYG1mWe VbxG85wqO+TU1brJ0Mg42Jl14sXtkFr6pqcyZHiTan22d4WFG9p0ptCwu6Y4/PhrCn9QEEL JuToXATUC0n7karJOIRiw== X-UI-Out-Filterresults: notjunk:1;V03:K0:30I06vuRZII=:iglrHyHvq1cn+izz6SoGs2 pJSCM5do/BLUINIz7Hm7bPQN1qej38HbfHLTiN9yL1DkOUuICHNLmRbW4Ssz17RQHZPWRpdvX AmIib1U7kkSbO8vAjUIEe66NmYbpex7oEmvwt1fEMUMky5iZ6oZjxSgHpqR8ATvcD7bRDnIex gwKySJyPJBRTswgMpqqI/w+uzEOyUzXMLmFnKh83Y9R9Tjq6X3i0R6NF57QxUK8WKa3dUx4Mb paGfUv1B6YXbzVNlpuUu4PcbNIhkeTDmidGp9CKoBjMcOmnFNG+NimOc4jfn/FwYdkSNFhkx3 H6w6m1q+gWnm55ABtZddvacoM9AN90zFtDN2fwRUpiz+RDHkAs9frvICHuAKt2npWXyCThZ3b W1fvFhXtLzCOhU577F9MPSS87gCpCC8FAwHbh0zRLwnKt4fm+/lvhlYqr1GnbIsjosHs+WvtW LSfsIwRVUmnj4RiQJYtkvssezaNKm/SD7/5X0tDNs9JTiHp2GdnwB9wtLZTj3Chk2+JG6w0+I 30eaF3wGOdueeU/LDI2JVj/6PROvYtsCUpnV3rQMctp31qCmAMISPD4e6WQtYG76wUgujSZH+ RYKtoKqInTjaIMX//80VL8C9ExMos8rJExAX/mSmwhUEX5e3RkPIVrJ++jbTbgoSbNICGbqpk b/bWzR46TfeiE7bkShaa+DgLZw+hNgcM3glSBkK4/FvfhOnDxlNDVr3wTkaajT/zGCxY= X-Spam-Status: No, score=-3.7 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=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 19RIuU4u014918 Am 27.10.2021 um 20:52 schrieb Thomas Wolff: > > Am 27.10.2021 um 12:55 schrieb Hannes Domani: >>   Am Mittwoch, 27. Oktober 2021, 11:19:19 MESZ hat Thomas Wolff >> Folgendes geschrieben: >> >>> I noticed that mintty did not compile anymore after upgrade to gcc 11, >>> but only on cygwin 32-bit. >>> I tried to minimize the test case as much as possible without having >>> the >>> bug vanish, to the attached standalone file. >>> Compile this with >>> cc -O2 -Wall -Werror m0.c >>> and it gives a false positive warning about possible uninitialized data >>> usage. >>> While data flow analysis is not perfect, it is weird that this used to >>> happen on 32 bit but not on 64 bit. >>> Meanwhile, after updating some other packages (not sure which), but >>> still the same gcc version, the report on the test case also happens on >>> 64 bit, while the original, unstripped file, as part of mintty, still >>> works without error on 64 bit, which is even weirder. >>> I have not yet had the opportunity to test this on Linux, sorry, so I'm >>> reporting it here. >>> Thomas >> If you mean this warning: >> >> m0.c: In function 'do_bidi': >> m0.c:256:12: error: '*types[0]' may be used uninitialized >> [-Werror=maybe-uninitialized] >> >> This warning is correct, because as far as gcc is concerned, count could >> be 0, and in this case types[0] will be uninitialized (and doesn't even >> exist, since it's declared as 'uchar types[count];'). > Thanks for the hint. I acknowledge that the analyser cannot know that > count > 0 here. But if types[0] exists, it cannot be unitialized so > the wording of the warning is not correct in this case. Anyway, this > leads to a less obtrusive workaround than the current one. And, forgot to mention, it's still mysterious how the distinction 32bit/64bit makes a difference about the warning to occur. Kind regards Thomas -- 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