From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ABC183858401; Thu, 1 Jun 2023 12:48:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABC183858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685623714; bh=cR8erUKNgATIfbM4jipymLWSYjcfyrMKLCx1iTjdWDU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bjNjKG67rbQhgwRO9LlVpV2+2If4kIh1+1KBjW7pw51Z8VtSnYA4hlaB0j9OdnEqy K1g0yHOpFRe4PmMwcIrghZwTln2SEf24lFO2DdGyU2XIcYcsUiEJc39gSuV5AER5Xg W78VxfzcNf1WLupBcLmrpSHWhbpU0lS8SR/NBRGQ= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110052] useless local variable not optimized away Date: Thu, 01 Jun 2023 12:48:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110052 --- Comment #5 from Alexander Monakov --- There are other reasons why it's invalid. For instance, in a multi-threaded program it could introduce a data race on assignment to foo->size inside of 'myrealloc' where the original program might have aborted without invoking = UB. Can you give more context about the problem you're trying to solve?=