From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 43462388E82B; Sat, 27 Jun 2020 11:49:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43462388E82B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593258558; bh=VgIykXvzF3bheNnqiRfKqUPsliNlkrVd97vp7Qr3zvM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=afuHT5xF0I9DpsTWzVS0uyALziBEQJmpvAIU0MgQOioOFWerTqZFRssTfm25MhKC7 E9bbb0rHh9JicDoTp+axs6vj5ZBwWXoA3NwP/hCcrIrFbA/isLIbFzkoxyZzyBquwN Ww2HTgBxdYZqG/PQ+uTTZ2llUS2GJZiXpftbPjSY= From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95663] static_cast checks for null even when the pointer is dereferenced Date: Sat, 27 Jun 2020 11:49:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org 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 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, 27 Jun 2020 11:49:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95663 --- Comment #12 from Marc Glisse --- (In reply to Jeffrey A. Law from comment #10) > __builtin_trap emits an actual trap into the instruction stream which hal= ts > the process immediately which is *much* better from a security standpoint Regardless of what the default is, I think we should be able to agree that there are uses where we want to favor hardening/security (public facing servers, web browsers), and others where performance is more important (scientific simulations), and it would be nice to give users a choice. (I think sanitizers already provide a way to turn __builtin_unreachable into __builtin_trap, but that's more meant for explicit __builtin_unreachable in user code)=