[{"id":38967,"web_url":"https://patchwork.libcamera.org/comment/38967/","msgid":"<177996910417.907573.6967557258853162724@ping.linuxembedded.co.uk>","date":"2026-05-28T11:51:44","subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Simon,\n\nThank you for your patch,\n\nQuoting Simon Parri (2026-05-27 18:10:37)\n> The function PiSPCameraData::beOutputDequeue in pipelines/rpi/pisp.cpp\n> contains a variable \"index\" that is initialized in the loop along with the\n> variable \"stream\". When -ftree-vrp is not enabled, GCC cannot analyze the\n> code to determine that after \"ASSERT(stream)\", \"index\" will always be\n> initialized. Since it cannot determine that \"index\" will always be\n> initialized, it emits a warning, which is elevated to an error.\n> \n> If the rpi/pisp pipeline is to be built, and the compiler is GCC, add\n> -ftree-vrp to project arguments for C++.\n> \n> This is not needed for Clang, since Clang always does the appropriate level of\n> code analysis (even at -O0).\n> ---\n> \n> Notes:\n>     I would like advice on whether using \"add_project_arguments\" is the correct\n>     thing to do here. It feels somewhat wrong to me because all the other\n>     flags (as far as I can tell) are set via common_arguments / c_arguments /\n>     cpp_arguments. However, since I need to check the enabled pipelines, I put the check\n>     after the code that sets the \"pipelines\" variable.\n\nIndeed, I don't think I would tackle this through a global flag. This\nwill now change how all parts are built depending on whether RPi is\nincluded.\n\n\n>     Or is my approach wrong to begin with? Should I be adjusting the code itself\n>     instead of adding compiler flags? In my opinion, adding compiler flags is the\n>     correct approach, since the code already works as-is with Clang.\n\nI haven't looked at if the code itself could be updated, but at least I\nwould say that if we need a specific compile flag it should only be\nassociated against the single file impacted ideally.\n\nPerhaps at least we could push this down into the pipeline handler\nmeson.build itself. \n\n\nI think src/libcamera/pipeline/rpi/pisp/meson.build should be the right\nplace and this file wouldn't be parsed if the pisp isn't enabled.\n\n--\nRegards\n\nKieran\n\n\n>     \n>     Thank you for your attention.\n> \n>  meson.build | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/meson.build b/meson.build\n> index 9cd73462f..0344c55bb 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -241,6 +241,10 @@ else\n>      pipelines = wanted_pipelines\n>  endif\n>  \n> +if cc.get_id() == 'gcc' and pipelines.contains('rpi/pisp')\n> +    add_project_arguments('-ftree-vrp', language : 'cpp')\n> +endif\n> +\n>  # Tests require the vimc pipeline handler, include it automatically when tests\n>  # are enabled.\n>  if get_option('test')\n> -- \n> 2.51.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6AD8ABDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 May 2026 11:51:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 93B7562FD3;\n\tThu, 28 May 2026 13:51:48 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 25CFF6175A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 May 2026 13:51:47 +0200 (CEST)","from monstersaurus.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F6C4219;\n\tThu, 28 May 2026 13:51:27 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"bCDGGjms\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1779969087;\n\tbh=/dVmxHnEuAaByPCNvCkNZE0idw4Yc9WOXTKB+qddjP0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=bCDGGjmskRggxfD5fOI9uaZuX3Cbjjaw+HPUp0EzYXp6gyMQNC+1gYJ4kM/EV+LvS\n\tOaQl2kH3buu+4Zk9+Pbh/3AaoAT4RLphpms6T1JVByqSWQ0o3QhRXsV7/PAs0hJiBx\n\t0TGkOqXXhdsV/ZNzNdORbKWHXsof/ydQ8jWxBt4Y=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260527171041.110173-1-simonparri@ganzeria.com>","References":"<20260527171041.110173-1-simonparri@ganzeria.com>","Subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Simon Parri <simonparri@ganzeria.com>","To":"Simon Parri <simonparri@ganzeria.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 28 May 2026 12:51:44 +0100","Message-ID":"<177996910417.907573.6967557258853162724@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38971,"web_url":"https://patchwork.libcamera.org/comment/38971/","msgid":"<871pevvaqr.fsf@ganzeria.com>","date":"2026-05-28T15:01:48","subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","submitter":{"id":263,"url":"https://patchwork.libcamera.org/api/people/263/","name":"Simon Parri","email":"simonparri@ganzeria.com"},"content":"Hi Kieran,\n\nKieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Hi Simon,\n>\n> Thank you for your patch,\n\nThank you for taking a look at it.\n\n> Quoting Simon Parri (2026-05-27 18:10:37)\n>> The function PiSPCameraData::beOutputDequeue in pipelines/rpi/pisp.cpp\n>> contains a variable \"index\" that is initialized in the loop along with the\n>> variable \"stream\". When -ftree-vrp is not enabled, GCC cannot analyze the\n>> code to determine that after \"ASSERT(stream)\", \"index\" will always be\n>> initialized. Since it cannot determine that \"index\" will always be\n>> initialized, it emits a warning, which is elevated to an error.\n>>\n>> If the rpi/pisp pipeline is to be built, and the compiler is GCC, add\n>> -ftree-vrp to project arguments for C++.\n>>\n>> This is not needed for Clang, since Clang always does the appropriate level of\n>> code analysis (even at -O0).\n>> ---\n>>\n>> Notes:\n>>     I would like advice on whether using \"add_project_arguments\" is the correct\n>>     thing to do here. It feels somewhat wrong to me because all the other\n>>     flags (as far as I can tell) are set via common_arguments / c_arguments /\n>>     cpp_arguments. However, since I need to check the enabled pipelines, I put the check\n>>     after the code that sets the \"pipelines\" variable.\n>\n> Indeed, I don't think I would tackle this through a global flag. This\n> will now change how all parts are built depending on whether RPi is\n> included.\n\nAh, I see I forgot to make it clear that the patch only enables the flag\nif rpi/pisp is in the list of pipelines to be built. I agree that it\nwould not be appropriate to enable it unconditionally.\n\n>>     Or is my approach wrong to begin with? Should I be adjusting the code itself\n>>     instead of adding compiler flags? In my opinion, adding compiler flags is the\n>>     correct approach, since the code already works as-is with Clang.\n>\n> I haven't looked at if the code itself could be updated, but at least I\n> would say that if we need a specific compile flag it should only be\n> associated against the single file impacted ideally.\n\nAs far as I can tell, Meson does not support adding flags per file, only\nper project. Upstream suggests defining a separate static library for\nfiles that should have separate flags, which is not a great solution in\nmy opinion.\n\n> Perhaps at least we could push this down into the pipeline handler\n> meson.build itself.\n>\n> I think src/libcamera/pipeline/rpi/pisp/meson.build should be the right\n> place and this file wouldn't be parsed if the pisp isn't enabled.\n\nActually, that was the first place I tried to put it. It seems to me\nthat adding it there is difficult, since by the time the pipeline\nhandler's meson.build runs there are already targets declared, and meson\ndoes not allow adding flags when there are already targets declared.\n\nShould I try rearranging the subdir() calls in src/libcamera/build.meson\nto try to get src/libcamera/pipeline/rpi/pisp/meson.build to run before\nany targets are declared?  I’m not sure how to go about that.\n\nThanks again for the review.\n\n(Kieran, sorry for the double-send, I forgot to reply to all.)\n--\nSimon Parri","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5D019C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 May 2026 15:02:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E319763024;\n\tThu, 28 May 2026 17:01:58 +0200 (CEST)","from omta002.uswest2.a.cloudfilter.net\n\t(omta002.uswest2.a.cloudfilter.net [35.164.127.225])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A89016175A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 May 2026 17:01:56 +0200 (CEST)","from mcc-obgw-6001b.ext.cloudfilter.net ([10.244.128.83])\n\tby cmsmtp with ESMTP\n\tid SbGlwboyjqyiTScF8wOBh1; Thu, 28 May 2026 15:01:54 +0000","from localhost ([173.16.167.196]) by cmsmtp with ESMTPS\n\tid ScF4w8w7D115FScF6wFnTx; Thu, 28 May 2026 15:01:54 +0000"],"X-Authority-Analysis":"v=2.4 cv=Z7HsHGRA c=1 sm=1 tr=0 ts=6a1858e2\n\ta=VPmDnoH/21K0g3l4Zi3lTQ==:117 a=VPmDnoH/21K0g3l4Zi3lTQ==:17\n\ta=IkcTkHD0fZMA:10 a=P1BnusSwAAAA:8 a=FhCRtMU8S_qJso14f9EA:9\n\ta=QEXdDO2ut3YA:10 a=D0XLA9XvdZm18NrgonBM:22","From":"Simon Parri <simonparri@ganzeria.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","In-Reply-To":"<177996910417.907573.6967557258853162724@ping.linuxembedded.co.uk>","References":"<20260527171041.110173-1-simonparri@ganzeria.com>\n\t<177996910417.907573.6967557258853162724@ping.linuxembedded.co.uk>","User-Agent":"mu4e 1.12.13; emacs 31.0.50","Date":"Thu, 28 May 2026 17:01:48 +0200","Message-ID":"<871pevvaqr.fsf@ganzeria.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-CMAE-Envelope":"MS4xfJpvWHNbRqugyNjpncIy0vYt0VGq0KZUirGNxf0ehesVSh6D8AONFzAoHxILUN8s71qXmnS89TbqPz8+oFfl61PNjQ+5SUBNehC8phT1Oigzjn7kFcxL\n\t7eKvvR0dZOKgn9ND2xmG8rlB9+K3/kJQsDYqOn9/6QBX5uBOBq3DuUmSDuNlbB0khf95HvAbDsqtL1AEzPpFkAya8G3D98qWcsPxkjDFIfwv4FhPRR0xx4AA\n\t0LDSQalmGaM+QNyyuSjdlw==","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38992,"web_url":"https://patchwork.libcamera.org/comment/38992/","msgid":"<2bbac34d-7244-4132-977c-bbc084a56bc9@ideasonboard.com>","date":"2026-06-04T08:18:39","subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2026. 05. 28. 17:01 keltezéssel, Simon Parri írta:\n> Hi Kieran,\n> \n> Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n> \n>> Hi Simon,\n>>\n>> Thank you for your patch,\n> \n> Thank you for taking a look at it.\n> \n>> Quoting Simon Parri (2026-05-27 18:10:37)\n>>> The function PiSPCameraData::beOutputDequeue in pipelines/rpi/pisp.cpp\n>>> contains a variable \"index\" that is initialized in the loop along with the\n>>> variable \"stream\". When -ftree-vrp is not enabled, GCC cannot analyze the\n>>> code to determine that after \"ASSERT(stream)\", \"index\" will always be\n>>> initialized. Since it cannot determine that \"index\" will always be\n>>> initialized, it emits a warning, which is elevated to an error.\n>>>\n>>> If the rpi/pisp pipeline is to be built, and the compiler is GCC, add\n>>> -ftree-vrp to project arguments for C++.\n>>>\n>>> This is not needed for Clang, since Clang always does the appropriate level of\n>>> code analysis (even at -O0).\n>>> ---\n>>>\n>>> Notes:\n>>>      I would like advice on whether using \"add_project_arguments\" is the correct\n>>>      thing to do here. It feels somewhat wrong to me because all the other\n>>>      flags (as far as I can tell) are set via common_arguments / c_arguments /\n>>>      cpp_arguments. However, since I need to check the enabled pipelines, I put the check\n>>>      after the code that sets the \"pipelines\" variable.\n>>\n>> Indeed, I don't think I would tackle this through a global flag. This\n>> will now change how all parts are built depending on whether RPi is\n>> included.\n> \n> Ah, I see I forgot to make it clear that the patch only enables the flag\n> if rpi/pisp is in the list of pipelines to be built. I agree that it\n> would not be appropriate to enable it unconditionally.\n> \n>>>      Or is my approach wrong to begin with? Should I be adjusting the code itself\n>>>      instead of adding compiler flags? In my opinion, adding compiler flags is the\n>>>      correct approach, since the code already works as-is with Clang.\n>>\n>> I haven't looked at if the code itself could be updated, but at least I\n>> would say that if we need a specific compile flag it should only be\n>> associated against the single file impacted ideally.\n\nThe code has been changed to avoid such warnings already multiple times:\n\n   * https://patchwork.libcamera.org/patch/20454/\n   * https://patchwork.libcamera.org/patch/22997/\n\nso I don't think that's is problematic.\n\n> \n> As far as I can tell, Meson does not support adding flags per file, only\n> per project. Upstream suggests defining a separate static library for\n> files that should have separate flags, which is not a great solution in\n> my opinion.\n> \n>> Perhaps at least we could push this down into the pipeline handler\n>> meson.build itself.\n>>\n>> I think src/libcamera/pipeline/rpi/pisp/meson.build should be the right\n>> place and this file wouldn't be parsed if the pisp isn't enabled.\n> \n> Actually, that was the first place I tried to put it. It seems to me\n> that adding it there is difficult, since by the time the pipeline\n> handler's meson.build runs there are already targets declared, and meson\n> does not allow adding flags when there are already targets declared.\n> \n> Should I try rearranging the subdir() calls in src/libcamera/build.meson\n> to try to get src/libcamera/pipeline/rpi/pisp/meson.build to run before\n> any targets are declared?  I’m not sure how to go about that.\n\nIf a compiler flag is to be added, I think the static library approach is\nbetter than trying to rearrange things so that `add_project_arguments()`\ncan be done from the subdir at the appropriate time.\n\n\n> \n> Thanks again for the review.\n> \n> (Kieran, sorry for the double-send, I forgot to reply to all.)\n> --\n> Simon Parri","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 01169C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jun 2026 08:18:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C001F631AC;\n\tThu,  4 Jun 2026 10:18:44 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EC56062DC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jun 2026 10:18:43 +0200 (CEST)","from [192.168.0.185] (catv-80-99-226-21.catv.fixed.one.hu\n\t[80.99.226.21])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0EC3113D7;\n\tThu,  4 Jun 2026 10:18:19 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jZVGLofu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1780561099;\n\tbh=AKt1546H4fn+SU2w2TE89My/LDyKnt+wTwbZ3Wx363I=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=jZVGLofuocaZILCQ9TpORGQWb1KyVD9dr7ZwpEZQMhE8zP0FAzWQlDwA1S7HSkIyB\n\tZcp/SQSasavBG1i8PWeegMkPxgtCkQdiJloaPLtOeepR78C2D3gVR26YyAhM8mYPC4\n\tYOVDu7DRor2wWgD9KwbC01IzZxg6buApUPXLcr/E=","Message-ID":"<2bbac34d-7244-4132-977c-bbc084a56bc9@ideasonboard.com>","Date":"Thu, 4 Jun 2026 10:18:39 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","To":"Simon Parri <simonparri@ganzeria.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260527171041.110173-1-simonparri@ganzeria.com>\n\t<177996910417.907573.6967557258853162724@ping.linuxembedded.co.uk>\n\t<871pevvaqr.fsf@ganzeria.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<871pevvaqr.fsf@ganzeria.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":39008,"web_url":"https://patchwork.libcamera.org/comment/39008/","msgid":"<87cxy6gfa3.fsf@ganzeria.com>","date":"2026-06-04T21:35:32","subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","submitter":{"id":263,"url":"https://patchwork.libcamera.org/api/people/263/","name":"Simon Parri","email":"simonparri@ganzeria.com"},"content":"Hello, Barnabás,\n\nBarnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> Hi\n>\n> 2026. 05. 28. 17:01 keltezéssel, Simon Parri írta:\n>> Hi Kieran,\n>> Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n>>\n>>> Hi Simon,\n>>>\n>>> Thank you for your patch,\n>> Thank you for taking a look at it.\n>>\n>>> Quoting Simon Parri (2026-05-27 18:10:37)\n>>>> The function PiSPCameraData::beOutputDequeue in pipelines/rpi/pisp.cpp\n>>>> contains a variable \"index\" that is initialized in the loop along with the\n>>>> variable \"stream\". When -ftree-vrp is not enabled, GCC cannot analyze the\n>>>> code to determine that after \"ASSERT(stream)\", \"index\" will always be\n>>>> initialized. Since it cannot determine that \"index\" will always be\n>>>> initialized, it emits a warning, which is elevated to an error.\n>>>>\n>>>> If the rpi/pisp pipeline is to be built, and the compiler is GCC, add\n>>>> -ftree-vrp to project arguments for C++.\n>>>>\n>>>> This is not needed for Clang, since Clang always does the appropriate level of\n>>>> code analysis (even at -O0).\n>>>> ---\n>>>>\n>>>> Notes:\n>>>>      I would like advice on whether using \"add_project_arguments\" is the correct\n>>>>      thing to do here. It feels somewhat wrong to me because all the other\n>>>>      flags (as far as I can tell) are set via common_arguments / c_arguments /\n>>>>      cpp_arguments. However, since I need to check the enabled pipelines, I put the check\n>>>>      after the code that sets the \"pipelines\" variable.\n>>>\n>>> Indeed, I don't think I would tackle this through a global flag. This\n>>> will now change how all parts are built depending on whether RPi is\n>>> included.\n>> Ah, I see I forgot to make it clear that the patch only enables the flag\n>> if rpi/pisp is in the list of pipelines to be built. I agree that it\n>> would not be appropriate to enable it unconditionally.\n>>\n>>>>      Or is my approach wrong to begin with? Should I be adjusting the code itself\n>>>>      instead of adding compiler flags? In my opinion, adding compiler flags is the\n>>>>      correct approach, since the code already works as-is with Clang.\n>>>\n>>> I haven't looked at if the code itself could be updated, but at least I\n>>> would say that if we need a specific compile flag it should only be\n>>> associated against the single file impacted ideally.\n>\n> The code has been changed to avoid such warnings already multiple times:\n>\n>   * https://patchwork.libcamera.org/patch/20454/\n>   * https://patchwork.libcamera.org/patch/22997/\n>\n> so I don't think that's is problematic.\n\nAh, I see. In that case it does seem easier to simply initialize \"index\"\nin this case as well. Should it simply be initialized to 0?\n\n>> As far as I can tell, Meson does not support adding flags per file, only\n>> per project. Upstream suggests defining a separate static library for\n>> files that should have separate flags, which is not a great solution in\n>> my opinion.\n>>\n>>> Perhaps at least we could push this down into the pipeline handler\n>>> meson.build itself.\n>>>\n>>> I think src/libcamera/pipeline/rpi/pisp/meson.build should be the right\n>>> place and this file wouldn't be parsed if the pisp isn't enabled.\n>> Actually, that was the first place I tried to put it. It seems to me\n>> that adding it there is difficult, since by the time the pipeline\n>> handler's meson.build runs there are already targets declared, and meson\n>> does not allow adding flags when there are already targets declared.\n>> Should I try rearranging the subdir() calls in src/libcamera/build.meson\n>> to try to get src/libcamera/pipeline/rpi/pisp/meson.build to run before\n>> any targets are declared?  I’m not sure how to go about that.\n>\n> If a compiler flag is to be added, I think the static library approach is\n> better than trying to rearrange things so that `add_project_arguments()`\n> can be done from the subdir at the appropriate time.\n\nIf that’s the route to go I can look into it, but initializing the\nvariable seems simpler to me.\n\n>> Thanks again for the review.\n>> (Kieran, sorry for the double-send, I forgot to reply to all.)\n>> --\n>> Simon Parri\n\n--\nSimon Parri","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DACDCC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jun 2026 21:35:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EBC8763735;\n\tThu,  4 Jun 2026 23:35:39 +0200 (CEST)","from omta004.useast.a.cloudfilter.net\n\t(omta004.useast.a.cloudfilter.net [34.195.253.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E608662DC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jun 2026 23:35:38 +0200 (CEST)","from mcc-obgw-6001b.ext.cloudfilter.net ([10.244.128.83])\n\tby cmsmtp with ESMTP\n\tid V5p1wrQUP6XeCVFizwgGQ7; Thu, 04 Jun 2026 21:35:37 +0000","from localhost ([173.16.167.196]) by cmsmtp with ESMTPS\n\tid VFivwMROXgpptVFixwE9Rf; Thu, 04 Jun 2026 21:35:37 +0000"],"X-Authority-Analysis":"v=2.4 cv=dpzbC0g4 c=1 sm=1 tr=0 ts=6a21efa9\n\ta=VPmDnoH/21K0g3l4Zi3lTQ==:117 a=VPmDnoH/21K0g3l4Zi3lTQ==:17\n\ta=IkcTkHD0fZMA:10 a=YAyIRdgMAAAA:8 a=P1BnusSwAAAA:8\n\ta=lNSKGSGd0hDgtemclz4A:9\n\ta=QEXdDO2ut3YA:10 a=o1rO4XtwZBNj6n05oSJ_:22 a=D0XLA9XvdZm18NrgonBM:22","From":"Simon Parri <simonparri@ganzeria.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH] meson: Make rpi/pisp pipeline build on GCC at low\n\toptimization","In-Reply-To":"<2bbac34d-7244-4132-977c-bbc084a56bc9@ideasonboard.com>","References":"<20260527171041.110173-1-simonparri@ganzeria.com>\n\t<177996910417.907573.6967557258853162724@ping.linuxembedded.co.uk>\n\t<871pevvaqr.fsf@ganzeria.com>\n\t<2bbac34d-7244-4132-977c-bbc084a56bc9@ideasonboard.com>","User-Agent":"mu4e 1.12.13; emacs 31.0.50","Date":"Thu, 04 Jun 2026 23:35:32 +0200","Message-ID":"<87cxy6gfa3.fsf@ganzeria.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-CMAE-Envelope":"MS4xfPWBojwTieql2e+fxTlr2ijbVVeyLZRgzRVVIWYm6y7GEUjbsxNuU3U9HcmaJm+yM9+gWA/tf/FJkgzldcRVYzVCnrsrFen2ynOwJuQfdx2csS21AybH\n\tJwo/9vePM40BfOcVZZ1ipsB/hdOI7Oauw9VlrAF6bXsUxtq9MIgmmcwUm6PmtXvlW/i8VsAipjbK1ujQ/MlIxpLOl0znQXrrs+qn8M4rZABnUCk+lsnHLjz8\n\t+Zrj5HXNOLUlWJQuNzdPiBGRPTSp4oQHsiYYka/H2wVwmcwbCiZf1Apk1euCfFmE/dh2gQHV78LUV8nGyi1Qbw==","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]