From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0303F3858413; Sat, 20 Jan 2024 00:47:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0303F3858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705711650; bh=p5HY+CcvNAObCz9jhlLB/kpbubnE3F9uJIs+YCswMys=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GVDqbBB752w8K70gIbCM7Hv4QxX2oJPpGJNgb4jjgChe0ax7lr6mhkmYhlfzKI2oQ 9rgKo4AvmiFMtainG/N1zvmehnVy1Q5bXl91HV7EFQtpyxiJVZHUm1i3VQsyVcppwN 1zJLjoD8OqS4IV7vrug9Q6/TvsRpz1i5Q5jOx71c= From: "isanbard at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113514] Wrong __builtin_dynamic_object_size when using a set local variable Date: Sat, 20 Jan 2024 00:47:29 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: isanbard at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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=3D113514 --- Comment #3 from Bill Wendling --- (In reply to Andrew Pinski from comment #1) > The answer is not really and it is complex. >=20 Okay. It just seems counter-intuitive. > So I will note that clang/LLVM returns 48 for `f.bar[argc], 1` and 0 for > `,3`. Yeah. I'm trying to fix that, but the consensus is that returning the maxim= um value of the whole object (not sub-object) when the LSB is set is okay due = to this in the documentation: > If there are multiple objects ptr can point to and all of them are known = at compile time, the returned number is the maximum of remaining byte count= s in those objects if type & 2 is 0 and minimum if nonzero. Note, I don't agree with that viewpoint.=