From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 4CA843858D35 for ; Wed, 30 Aug 2023 19:24:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4CA843858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31c479ede21so5115337f8f.2 for ; Wed, 30 Aug 2023 12:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693423444; x=1694028244; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XH9a6A+Xkzuh6EVZY8kgxb+38ARSMlRkiQVxg8QDmgs=; b=bhsjrplWI06VcNPSwn0MjLvP/xfAoR3bO8OP7TGwpB8zkfYzAQxZZTh6nrNz0LSV2Q zzkfunT7PAEVwLR7k/pVqBtGFZbasF/xGMOP+Ns2EhlXtARO+hUtfLhfcAoIQeIAfUXF f8lCYfoYTEudEL9s2rdeSN6cWwfsx2J131HTHrYVkAngc9s199ZXyDbp36r3s7r0qRYB E17A3ywZj+7bjiVDM4deCeODO384NBf7ZfrhGmfGItnXYXCbM4baGuOGYu3rBITl9J4j 4Ti+icf5b9kssy2l3W93RknoyeHp8hu5U1hPVb2SP/sz3O9nq7otUT7bY/mRi9+UNLKP 7N/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693423444; x=1694028244; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XH9a6A+Xkzuh6EVZY8kgxb+38ARSMlRkiQVxg8QDmgs=; b=E5Tg5l5agqL1MdvdMWqeNoT7wMa077OZaeZcZMshqEHwdBaRDRKGmsw6jyH5kT8kt6 DqnW8jVjyA9Wk7qDTRmLwq7yICPZDjcR/WYzTnsTboU87DZjJNK22QHphA7JUyOzXrA9 c0gFSWfSZjFHTOsMOCDSOhTT8Xux6kE15mfH+Y/LVOIF8a6En4gTnMfqVvaVEteN2iCK Hferi2+DsdpYPeyvG5mEJTHwjIz4xV5z73FpqNd/km2qekoou3OwlkqmaZHIvSWu0TPw WfIhrfdBu9swHKu+6jRHojIaCVr1OAtL0a+VDChmo8heWWNrs9mylL6/fhTwNk0/XhpL jPOg== X-Gm-Message-State: AOJu0YwBGjud5/LbG84R2WWKotZPuOdvxeTDR6xbbY1iEcDi6QauVPIS UlfNYvaPxkYbjKHNN8+6C6HgAvdNetSMMqUDnjk= X-Google-Smtp-Source: AGHT+IGznx3yOGs9p2n/05pUPPkFT5ikOulPsKO0N709J0+1Yhhx+9B6dLRHT0opPRJmQ7jkY4zQdGh4J6ZVvLkaxMs= X-Received: by 2002:a05:6000:10c7:b0:319:6ce2:e5a3 with SMTP id b7-20020a05600010c700b003196ce2e5a3mr2591062wrx.26.1693423443747; Wed, 30 Aug 2023 12:24:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 30 Aug 2023 20:23:50 +0100 Message-ID: Subject: Re: Miscompilation: missing assignment in function that might throw To: Brian Green Cc: gcc-help Content-Type: multipart/alternative; boundary="000000000000d1a775060428de1d" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000d1a775060428de1d Content-Type: text/plain; charset="UTF-8" On Wed, 30 Aug 2023, 18:39 Brian Green via Gcc-help, wrote: > I was unable to create an account in the gcc bugzilla, so I am trying to > report this here. > Please don't report bugs here. Did you send an email to get an account created, as bugzilla says to do? Because I don't see any request from you. > The following code should always exit with "5". Starting in g++ 12.1, it > will exit with "5" at "-O0" and with random garbage at "-O1" or "-O2". > > https://godbolt.org/z/T3qTnheYW > > struct Int { > int value; > }; > > __attribute__((noipa)) Int always_throws() { throw 123; } > > void foo(Int &x) { > try { > x = always_throws(); > } catch (...) { > } > } > > int main() { > Int x; > x.value = 5; > foo(x); > return x.value; > } > --000000000000d1a775060428de1d--