From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by sourceware.org (Postfix) with ESMTPS id 6175B3885C19 for ; Mon, 15 Jun 2020 17:32:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6175B3885C19 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gmx.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tbilles@gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1592242364; bh=ASh7sttl4iGbFc+1H30Foy56Qhig9hO6HQqVrgO/L9o=; h=X-UI-Sender-Class:Date:From:To:Subject; b=EcOwPc37+3MSmczc/Ov/CjLh7NjT7MWcuYVq69kav2ipn73A0w4WAZVZN87ms/Q2j grEdU421C0ea2ecK+/Oeba+9IshOC16nFDO1WZKq9/wgMOtiM2lFMUbHhL+st5QwEQ BwrMmIvhBm9gi+qsfNdxIM4kULWGHNO9gy6W9Cmg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.65.3] ([94.21.203.30]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MC30P-1jctHN2RWH-00CUgy for ; Mon, 15 Jun 2020 19:32:44 +0200 Date: Mon, 15 Jun 2020 19:32:37 +0200 (CEST) From: Tibor Billes X-X-Sender: tbilles@serpens To: gcc-help@gcc.gnu.org Subject: Undefined behavior or compiler bug? Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K1:0KLIAHw/DrBFZ50UkE+JnN1Pa2ph2Cn0eLySDf0QQbx5apOamgI 6ZvRhFnhBABhQBCxtU46KPWdJYbSRvHA+OByIbmffI3G7jDJMpVLYqk8Tg57AGCZTlo3KdG 0AhkjkoNZhYH288jhii3oZi95vsJU/R4lX5yX0N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rQeBLLxMXqypAVqbaJBL+/0e c5vprc2lfWdf1uACvuaDrNlSJV5qyewWkxOthM+Zq4z5cTwyf28CLYtnvmH3/EowtDDPQQ3+M Q3L6bjOpCoZu1jlRxVmcO/3jlgjnlTs+stbjRmb8R2QDGxueR5ZCQazQGRcExHP7SIPtueT98 /S2VGpbFHWQPfxwCXWFHYaNojjbRmj2dRHzSGgkjJ1QZy7tf704KLJZM629skuL05a/4hy2fW wcxNe1rUt/VNoKKNcvmeCYOSRScZZa63zHx06nOu1LIgLOlPwd5iG4VFKaHdWOIAdYGSmurqH 1OTzxj+mSrlJtXNdY Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 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: Mon, 15 Jun 2020 17:32:48 -0000 Hi, I'm using the -fsanitize=3Dundefined flag and got a runtime error after a compiler upgrade from 7.2 to 9.3. I was happy at first that the upgraded compiler caught an error that I can fix before it hits me in production. However after some investigation, I cannot figure out what's wrong in the code. That's why I seek help on this mailing list, can someone explain the bug to me? Or is it a bug in the compiler that I should report? The simplified version of the test code on Compiler Explorer: https://godbolt.org/z/7rAxJj It shows that different compiler versions behave differently. There is a comment on line 16 that explicitly defaults the Derived constructor. If you switch the comment with line 17, both compiler verions run fine without producing the runtime error although the defaulted constructor should be exactly the same the user defined one: https://godbolt.org/z/UShm-u Can someone please explain what's wrong? Thanks in advance, Tibor Billes