From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1B21C42AB6 for ; Sun, 12 Jun 2022 08:58:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2EEAE68B3DB; Sun, 12 Jun 2022 11:58:25 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60B3E68AF34 for ; Sun, 12 Jun 2022 11:58:18 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 25C8wH5j000652-25C8wH5k000652; Sun, 12 Jun 2022 11:58:17 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 7F50EA142E; Sun, 12 Jun 2022 11:58:17 +0300 (EEST) Date: Sun, 12 Jun 2022 11:58:16 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-15"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 12 Jun 2022, Martin Storsj=F6 wrote: > On Sun, 12 Jun 2022, Soft Works wrote: > >> = >> = >>> -----Original Message----- >>> From: ffmpeg-devel On Behalf Of >>> Andreas Rheinhardt >>> Sent: Sunday, June 12, 2022 7:28 AM >>> To: ffmpeg-devel@ffmpeg.org >>> Cc: Andreas Rheinhardt >>> Subject: [FFmpeg-devel] [PATCH] all: Replace if (ARCH_FOO) checks by >>> #if ARCH_FOO >>> = >>> This is more spec-compliant because it does not rely >>> on dead-code elimination by the compiler. Especially >>> MSVC has problems with this, as can be seen in >>> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html >>> or >>> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html >>> = >>> This commit does not eliminate every instance where we rely >>> on the dead code elimination: It only tackles branching to >>> the initialization of arch-specific dsp code, not e.g. all >>> uses of CONFIG_ and HAVE_ checks. But maybe it is already >>> enough to compile FFmpeg with MSVC with whole-programm-optimizations >>> enabled (if one does not disable too many components). >>> = >>> Signed-off-by: Andreas Rheinhardt >>> --- >> = >> LGTM. >> = >> It's not really a story as simple as "poor MSVC is unable >> to perform dead-code-elimination". It is actually capable to do that, >> but the ffmpeg code was not only requiring the compiler to eliminate >> dead code, > >> it actually required a compiler to ignore dead code blocks >> even when those would contain invalid code that cannot be compiled >> at all. > > Can you qualify this statement? This does not match my understanding. ... because eliminating unused code (for e.g. debug printouts) using DCE = instead of ifdefs has got the advantage that the skipped code still is = syntax checked (so it doesn't bitrot), compared to in ifdefs where it can = easily become stale. Still not an argument against this patch, only against seemingly incorrect = statements. // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".