From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 4598F3858C2D for ; Sun, 21 Aug 2022 03:52:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4598F3858C2D Received: by mail-pg1-x52d.google.com with SMTP id 73so6683835pgb.9 for ; Sat, 20 Aug 2022 20:52:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=eQJWiJTUGvOyKscZK9CWhaxUbOxz/D+rivxdgdmjFtc=; b=L+XMpxm+0usiPcWDNyTs2k3xT+OZi635D8vR1/T89NAQP37Gh7rnfbBqzckVJarh+k L6RZSLLS+GTUiIWmVJ9QrzHrP8+JRQec7YZBC4xF0c0cEyouoZfah/b60006c0znSvIl KFPSU6oBLx8bxJSS3GXCNIsiqnChAO+yeepIS6FTcVYDUE2ftPJ9LFtdzkB4ugIn4jyU 1IvkNEU1Du0JW1/9vUgX43qixYIeBxtLBdrs9kdxw3CkRIUMp6ZsDq/CTa88mo/6oWPR Wng6/240pnkRTlpOkK/zw6Ac431O4tiAkNY4Rm0yZlFae5eEmqTpwXp0gpQ+1rGBjb6b g5TQ== X-Gm-Message-State: ACgBeo1klP+OVRPOSMQdzhoi07pP/62ZWAu51/wLaUh6Qps19kYc9PGb 6RU8GdItcDFrDs4FyCQo1TNtPWReFOwa3C/UaWs= X-Google-Smtp-Source: AA6agR79bk9u+22y8VyYBbtnnQbsHfTuc35DG1n6zbjE7H9CKw8hl+4stDQnXQU+KLhhSP6b6z/hgBBmCE02Q5B1Py0= X-Received: by 2002:a63:6c49:0:b0:41d:e04a:dd7d with SMTP id h70-20020a636c49000000b0041de04add7dmr11972715pgc.243.1661053963162; Sat, 20 Aug 2022 20:52:43 -0700 (PDT) MIME-Version: 1.0 References: <20220817071950.271762-1-juzhe.zhong@rivai.ai> <87h726h7et.fsf@linux-m68k.org> <4492011496002C16+202208210805415609851@rivai.ai> <504CA3A3842082E0+202208210828277008452@rivai.ai> In-Reply-To: <504CA3A3842082E0+202208210828277008452@rivai.ai> From: Andrew Pinski Date: Sat, 20 Aug 2022 20:52:30 -0700 Message-ID: Subject: Re: Re: [PATCH] RISC-V: Add runtime invariant support To: =?UTF-8?B?6ZKf5bGF5ZOy?= Cc: Andreas Schwab , gcc-patches , "kito.cheng" , andrew , rguenther Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2022 03:52:45 -0000 On Sat, Aug 20, 2022 at 5:29 PM =E9=92=9F=E5=B1=85=E5=93=B2 wrote: > > OK. Thank you. I am gonna try it again and fix this in RISC-V port. The fix is not in the RISC-V port, the fix needs to happen in vect_gen_vector_loop_niters (tree-vect-loop-manip.cc). I described why the code is broken, the second use of const_vf is not connected at all to vf.is_constant (&const_vf) so it will be uninitilized there. Thanks, Andrew > > ________________________________ > juzhe.zhong@rivai.ai > > > From: Andrew Pinski > Date: 2022-08-21 08:18 > To: =E9=92=9F=E5=B1=85=E5=93=B2 > CC: Andreas Schwab; gcc-patches; kito.cheng; andrew; rguenther > Subject: Re: Re: [PATCH] RISC-V: Add runtime invariant support > On Sat, Aug 20, 2022 at 5:06 PM =E9=92=9F=E5=B1=85=E5=93=B2 wrote: > > > > Hi, it seems that this warning still report if I revert my patch. Am I = right? Feel free to correct me. Maybe I need to try it again? > > The warning will not be still there. The reason is NUM_POLY_INT_COEFFS > defaults to 1 which means vf.is_constant (&const_vf) will always > return true and will always set const_vf. > I don't know why the warning does not happen on aarch64-linux-gnu (the > other target where NUM_POLY_INT_COEFFS is set to 2) though; it just > might be slightly different IR which causes the warning mechanism not > to warn. > > Thanks, > Andrew Pinski > > > > > > ________________________________ > > juzhe.zhong@rivai.ai > > > > > > From: Andrew Pinski > > Date: 2022-08-21 07:53 > > To: Andreas Schwab > > CC: juzhe.zhong; gcc-patches; kito.cheng; andrew; Richard Guenther > > Subject: Re: [PATCH] RISC-V: Add runtime invariant support > > On Sat, Aug 20, 2022 at 3:34 PM Andreas Schwab = wrote: > > > > > > This breaks bootstrap: > > > > > > ../../gcc/tree-vect-loop-manip.cc: In function 'void vect_gen_vector_= loop_niters(loop_vec_info, tree, tree_node**, tree_node**, bool)': > > > ../../gcc/tree-vect-loop-manip.cc:1981:26: error: 'const_vf' may be u= sed uninitialized [-Werror=3Dmaybe-uninitialized] > > > 1981 | unsigned HOST_WIDE_INT const_vf; > > > | ^~~~~~~~ > > > cc1plus: all warnings being treated as errors > > > make[3]: *** [Makefile:1146: tree-vect-loop-manip.o] Error 1 > > > make[2]: *** [Makefile:4977: all-stage2-gcc] Error 2 > > > make[1]: *** [Makefile:30363: stage2-bubble] Error 2 > > > make: *** [Makefile:1065: all] Error 2 > > > > > > This looks like a real uninitialized variable issue. > > I even can't tell if the paths that lead to using const_vf will be > > always set so how we expect GCC to do the same. > > The code that uses const_vf was added with r11-5820-cdcbef3c3310, > > CCing the author there. > > > > Thanks, > > Andrew > > > > > > > > -- > > > Andreas Schwab, schwab@linux-m68k.org > > > GPG Key fingerprint =3D 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA= AEC1 > > > "And now for something completely different." > > >