From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 720003857727; Fri, 12 May 2023 09:08:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 720003857727 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683882503; bh=xVRiJ3k+yglFXwQphxDQOnKNc6R7mUwrgHSMbnvbmt4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qJ9RrIOfmQ76qgMz2zWZsOcGJl24eYFNX3ahixy4FcA7KEggoaxC3WRBZ8HLbXExu txf+1Bn3M2usWHmi3LyZ3CxZKwBMmRnwCu0hkDvkU0vona6J4+sj558f+RKkvpYEzL 0nWqVlyrwKIeiiaezbyhYs3NUxwAxcB4AWLIJeuk= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/104069] Wuse-after-free=2 -O0 false positive "may be used" Date: Fri, 12 May 2023 09:08:22 +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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D104069 --- Comment #30 from Sergei Trofimovich --- > configure: WARNING: unrecognized options: --disable-werror > In function 'bigger_buffer', > inlined from '__libdw_gunzip' at gzip.c:374:12: > gzip.c:96:9: error: pointer may be used after 'realloc' > [-Werror=3Duse-after-free] > 96 | b =3D realloc (state->buffer, more -=3D 1024); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > gzip.c:94:13: note: call to 'realloc' here > 94 | char *b =3D realloc (state->buffer, more); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > make[2]: *** [Makefile:715: gzip.o] Error 1 You should be able to extract preprocessed file using https://gcc.gnu.org/bugs/#need: you will need to find exact `gcc` invocation that causes build failure, add `-save-temps` parameter to it, grab '*.i' fi= le and attach it along with exact command you used to produce it.=