From patchwork Wed May 27 17:10:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Parri X-Patchwork-Id: 26811 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 93AE6BDCBC for ; Wed, 27 May 2026 17:10:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BBC8C63024; Wed, 27 May 2026 19:10:51 +0200 (CEST) Received: from omta002.uswest2.a.cloudfilter.net (omta002.uswest2.a.cloudfilter.net [35.164.127.225]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF5A162E6A for ; Wed, 27 May 2026 19:10:49 +0200 (CEST) Received: from mcc-obgw-6002b.ext.cloudfilter.net ([10.244.128.100]) by cmsmtp with ESMTP id SFu5wmnMjk3IVSHmKwoXEF; Wed, 27 May 2026 17:10:48 +0000 Received: from localhost ([173.16.167.196]) by cmsmtp with ESMTPS id SHmGw6kiQJ8IOSHmIwTDkN; Wed, 27 May 2026 17:10:47 +0000 X-Authority-Analysis: v=2.4 cv=W9M4VQWk c=1 sm=1 tr=0 ts=6a172597 a=VPmDnoH/21K0g3l4Zi3lTQ==:117 a=VPmDnoH/21K0g3l4Zi3lTQ==:17 a=tGv0lvtu0_dalHgCflUA:9 From: Simon Parri To: libcamera-devel@lists.libcamera.org Cc: Simon Parri Subject: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low optimization Date: Wed, 27 May 2026 19:10:37 +0200 Message-ID: <20260527171041.110173-1-simonparri@ganzeria.com> X-Mailer: git-send-email 2.51.2 MIME-Version: 1.0 X-CMAE-Envelope: MS4xfIFnnazZiwn7i3au2Qfoc8AyM9zEVipUB0UGv1ZeC/WtY0q9rIIspPsWU+bPTTiL+5yvuceMTnH9KYVSZa9FLs+HaoJn3oIGRoHAkq5S72M7wNVFKMG+ YJZDa8OZhA30WZ1iuYFYEhJlm4oJQTqFzTP5TQiBA+Hv6mx15B7QG+Rn09tnJwp/M+OBWt1BGvO/oEjZY3Pbxz12c8tpRrT8tJVd8XHLBKxTrp+iUQoGQbF/ IfOEe3paP4I/Hg/KrTkWuw== X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The function PiSPCameraData::beOutputDequeue in pipelines/rpi/pisp.cpp contains a variable "index" that is initialized in the loop along with the variable "stream". When -ftree-vrp is not enabled, GCC cannot analyze the code to determine that after "ASSERT(stream)", "index" will always be initialized. Since it cannot determine that "index" will always be initialized, it emits a warning, which is elevated to an error. If the rpi/pisp pipeline is to be built, and the compiler is GCC, add -ftree-vrp to project arguments for C++. This is not needed for Clang, since Clang always does the appropriate level of code analysis (even at -O0). --- Notes: I would like advice on whether using "add_project_arguments" is the correct thing to do here. It feels somewhat wrong to me because all the other flags (as far as I can tell) are set via common_arguments / c_arguments / cpp_arguments. However, since I need to check the enabled pipelines, I put the check after the code that sets the "pipelines" variable. Or is my approach wrong to begin with? Should I be adjusting the code itself instead of adding compiler flags? In my opinion, adding compiler flags is the correct approach, since the code already works as-is with Clang. Thank you for your attention. meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index 9cd73462f..0344c55bb 100644 --- a/meson.build +++ b/meson.build @@ -241,6 +241,10 @@ else pipelines = wanted_pipelines endif +if cc.get_id() == 'gcc' and pipelines.contains('rpi/pisp') + add_project_arguments('-ftree-vrp', language : 'cpp') +endif + # Tests require the vimc pipeline handler, include it automatically when tests # are enabled. if get_option('test')