From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55F883858284; Wed, 11 Oct 2023 20:05:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55F883858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697054706; bh=OKIa7iN+ijL1z9Ot2WXxO27DpDca262BI2NSEc4OzDo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QspJGSGppj0/aXxRtXha0CqO9DxVwKztqwDTImWAIE47nXEv15JyUxMW4OnSIy1j5 jBglxTnRAVvtCRK4y6ljqDbtnIxgc0zP2L5S9MD1lH7saof9CyHbLgvww9feW4RP7Z yiqGCUw7WjBzDxlbgSescF/JMn3/RfzhHFaWy3rw= From: "ibuclaw at gdcproject dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/111537] ICE: in set_cell_span, at text-art/table.cc:148 with D front-end and -fanalyzer Date: Wed, 11 Oct 2023 20:05:06 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ibuclaw at gdcproject dot org X-Bugzilla-Status: ASSIGNED 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111537 --- Comment #7 from Iain Buclaw --- (In reply to David Malcolm from comment #5) > Is D correctly building that string_cst? Are D strings 0-terminated? Yes, D strings are 0-terminated. The way I've done it is, the string is constructed using build_string(3, "foo") but the TREE_TYPE is set to `char[4]` so that the terminating 0 is consider= ed. I'm sure it's like this because either GCC has a tendency to emit strings side-by-side without the 0 so strlen("foo") could return 20, or there's an optimization pass for strlen() that would otherwise evaluate strlen("foo") = into 2 if I set the type of the literal as `char[3]`.=