From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B0F23857C48; Sat, 30 Jan 2021 01:45:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B0F23857C48 From: "brian.sobulefsky at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/98797] Simpler version of the XFAIL in casts-1.c with proposed solution Date: Sat, 30 Jan 2021 01:45:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: brian.sobulefsky at protonmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 01:45:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98797 --- Comment #1 from Brian Sobulefsky --- I have updated the repository I linked previously so that it has current gcc sources and also includes a solution for the case where struct s2 is not a single field, that is, we have something like: struct s1 { char a; char b; char c; char d; }; struct s2 { char arr1[2]; char arr1[2]; }; struct s2 x =3D {{'A', 'B'}, {'C', 'D'}}; struct s1 *p =3D (struct s1 *)&x; __analyzer_eval (p->a =3D=3D 'A'); The solution I submitted basically has the logic right, but I put everything into binding_cluster:get_binding_recursive instead of creating a new method= for class binding_cluster, which is the right way to do it. I did this just to = have a quick outline of the solution without altering the class members, but in = my view get_binding_recursive is too cluttered this way and the code in the ca= se I added should be moved to a new function.=