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 266973858C27 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: Hannes Domani , "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> From: Thomas Wolff Message-ID: <61db07a8-e4d2-c1f1-83ca-5ba1c2a21317@towo.net> Date: Wed, 27 Oct 2021 20:52:34 +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: <530117425.2623944.1635332143429@mail.yahoo.com> X-Provags-ID: V03:K1:u9W5JJTqbTDhopK/WhpI8wWf0NdUJq6VQPPU5dL1CEigC5/OQV9 wnv0kVLr6GWcrtxNAb0MHcjhFgU8N8wRtC3hZyigaodrbDiOqNxLHa/D6TxUUKADp96DViQ pejbEfJh3cRrqbWCX2jSzNHLeBET+upQVYVkw3uX0n6bgtMjUbhjK/t0McxCGNT7Outuej1 55sNagtqISxEgFl1GYnfA== X-UI-Out-Filterresults: notjunk:1;V03:K0:C0Fs5Fd9e+I=:HT6o+jLDmG2z2bItKBeogV 7c3U39bdGgrMnSrnpPmU4ZU5/0aH1BN5el3nRG0Fa/oRWeoMbqOQgyxNWB6FikiL/trMtAH+p x+/8oof2gDkoavxxvFeyRycjpYlL+akey+DW2Gbx29cdrSmu8R8myjNu+YWlL2ImX1LECFBEE aI0MevpR303W+BFXsgxmCehkacM7KOAlBCWGTP2dgH9J0NfbB852jeUO5favVrVkJhRy4VmDy EAL3hwoCdK3Vqzd86VAQPe3yq2J5B/bNiDtA2oU5pyUuHFyO+V0utCWTgG1EykBv9O6Vhm3Qn KclzyNQuvTCpLiTMlP3xZ73jH0WXzWILLs9yoRQG7Sbk+1W/LBQFkbI74tqtVcQzTTDrtwmUX vf5kAHWa8vPGItTu/YGdz1cOVFemF7e5RPKn3F2ZQ9Ca/wZ88TzU7e3rPHniSU47z4ZMqs8k8 jTAcGubZA38Pe+6XE37zNEvIu/xBdch7bj13nzabribwYIB9cTZrwTmhh19vu1Gopr34KWM1E koBPjzpseeSQEn57sujtjR4l1458mrQatgheo2jlHPYdaRk6LgUJd2pN62uofpUGiM/U7FMes 5Yv81USSxMMtIjpM0V/OFxNTW8NR4O7Fnuj2FOmEZ147Xoyxqj4uMyzdA9mxWkmg+QVospOC1 AdleGaA3dW9RBpD3ntEMzN9THvRhQfZxEaSZeAndxQhbTQYpYJ0ozmJWO3WZ722mye80= 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_H4, RCVD_IN_MSPIKE_WL, 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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. 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