From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic306-2.consmr.mail.bf2.yahoo.com (sonic306-2.consmr.mail.bf2.yahoo.com [74.6.132.41]) by sourceware.org (Postfix) with ESMTPS id 6DFFF3851C27 for ; Wed, 6 Jan 2021 18:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6DFFF3851C27 X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1609957535; bh=RT2fVgGLHd5aVJTpBTHUE6VM+PYnexQcdHgxEsG/rwA=; h=Date:From:To:Subject:From:Subject; b=QHpVewt7sV4WvgPq6U5fBCnxjICgz9pEGdkjW5VtgYtd6/7fniISLKar2f9aBLOpcMYFKgDSsJ/IbPokUmFE3uIHY92cFBTJPLytMU3b3ecap3aTsnMebU/tdCRACnII/2gesywQLDJdqMep/8ac2ckZ0mGYaQK3GjsU9PNd/NhgbENLDqhAPMwY9DUuZsNt1sDrVX5+em5lbKKV+UTOG4S3TpcjUcJlchngUBCbllHEA9otyA7uUDfoGXp+yRQpayF64snJkwHmBL0YYLAP5BKgiahYfFT3yX0xGwaRcV0AEePVUvU0L3lcthvWQIaxPYCDpw7nirhmn/orZHfvlg== X-YMail-OSG: sh957b0VM1kZH_ioPkytRC3s.D1Qq7zMuqY8swi0xsYAqd.zJeDR_CvKlcOl8Eh TA5o8mFibMZJxjj6oUq3g6yBSZLForZxXz9zDZZoiUFB.VpNfJH_.Y0EqNxfxJRewqolm5eVFsD. D4kP.tGyFO9BXsYN87y0JjrxBJILFuw_XxJzzaimDytZLuUo1LfFyJON7O9cfNFeq85URjvl8fhf d3etp_fcD_rQzK27HHwxx7GxUC78ahN.IEwOAZW57iAevK1IA53UovIz7Wn2pC0pdJ0wbkMjdLJW 1xX.bcAxHovE3_POjumbutgQECkMb6dgplgE.YHDmCgTzGNC8QPRRi9DvBb9X3Jh4xgQJJMoID31 _52ig8_hytqjSyzNQmf1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Q5kKxnyyou_DTkXok8_W6xlDnSdNPM2_vA90hlj4a1boPJDW0siGmc 3q.el4xtyRnGhWdSMVs4pluAQnWSVYz7h7I2GmQyEOgLK.ZflOr2l Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Wed, 6 Jan 2021 18:25:35 +0000 Date: Wed, 6 Jan 2021 18:25:32 +0000 (UTC) From: Nick Savoiu To: "gcc-help@gcc.gnu.org" , Martin Sebor Message-ID: <1175951064.4800377.1609957532226@mail.yahoo.com> In-Reply-To: References: <1044085695.4037783.1609882274366.ref@mail.yahoo.com> <1044085695.4037783.1609882274366@mail.yahoo.com> Subject: Re: Help diagnosing a GCC 10.2 problem : error: 'removed_return.213' may be used uninitialized in this function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.17278 YMailNorrin Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0 X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2021 18:25:37 -0000 Hi Martin, the program crashes, not GCC. My code does not contain any 'removed_return'. I suspect that it's a GCC th= ing so it would probably not appear in a -E output. I'll try again to extract the behavior from the codebase. Nick On Wednesday, January 6, 2021, 9:20:19 AM PST, Martin Sebor wrote:=20 On 1/5/21 2:31 PM, Nick Savoiu via Gcc-help wrote: > Hi all, I'm trying to upgrade a codebase from GCC 9.1 to GCC 10.2 and run= ning into weird warning/error messages in the optimized build (-O2). >=20 >=C2=A0 =C2=A0 error: 'removed_return.213' may be used uninitialized in thi= s function [-Werror=3Dmaybe-uninitialized] >=20 > I thought that I can just downgrade the -Werror and go on but the code ac= tually crashes on that statement. Do you mean to say the compiler crashes or the program crashes at runtime?=C2=A0 The former would be a bug in the compiler.=C2=A0 The latter likely a bug in the program. The removed_return.213 name refers to a variable GCC synthesizes internally from one called removed_return in the code.=C2=A0 It just means that GCC can't prove the variable is initialized when it's used.=C2=A0 Initializing it on declaration should avoid the warning. >=20 > The problem code seems to be around a macro that looks like this: >=20 > extern bool IsDebugOn(); > #define debug IsDebugOn() && std::cout >=20 > and that's used like this: >=20 >=C2=A0 =C2=A0 debug << "print something" << std::endl; >=20 > The error goes away if I use >=20 >=C2=A0 =C2=A0=C2=A0 if (IsDebugOn()) >=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 debug << "print something" << endl; >=20 > so I guess the shortcircuited && somehow makes a difference. Unfortunatel= y this happens way deep in the code and any attempts so far to extract the = code such that it still exhibits the problem have failed. >=20 > I'd appreciate any pointers. If you suspect a bug in GCC then, at a minimum, we need to see the full GCC output (the warning/error, followed by any informational notes and stack trace if GCC dies with an ICE).=C2=A0 Better yet would be a translation unit (the result of preprocessing the file with -E) and the full command line so we can reproduce the problem.=C2=A0 Since you mentioned it's probably going to be too big for the list so opening a bug report and attaching the translation unit to it would be preferable. Martin