Re: [PATCH 1/1] s390/dasd: fix string length handling
From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2023-08-28 22:52:08
Also in:
linux-s390, lkml, llvm
From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2023-08-28 22:52:08
Also in:
linux-s390, lkml, llvm
On Mon, Aug 28, 2023 at 05:18:37PM +0000, David Laight wrote:
From: Heiko Carstensquoted
Sent: 28 August 2023 16:32 if (strlen(uid.vduit) > 0)Does the compiler know enough to optimise that brain-dead test?
For the purposes of skipping diagnostics, no; clang performs semantic analysis BEFORE optimization (which is handled by LLVM). As such, clang will produce diagnostics on dead code. Partly because LLVM isn't very ergonomic at emitting diagnostics from the backend, partly because Clang code owner and developers don't want clang to emit diagnostics dependent on optimization level. I disagree with my compatriots, and you can read more thoughts here: https://discourse.llvm.org/t/rfc-improving-clangs-middle-and-back-end-diagnostics/69261?u=nickdesaulniers