From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29160 invoked by alias); 9 Jul 2014 14:40:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29019 invoked by uid 89); 9 Jul 2014 14:40:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f172.google.com Received: from mail-we0-f172.google.com (HELO mail-we0-f172.google.com) (74.125.82.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 09 Jul 2014 14:40:52 +0000 Received: by mail-we0-f172.google.com with SMTP id u57so7512220wes.3 for ; Wed, 09 Jul 2014 07:40:49 -0700 (PDT) X-Received: by 10.180.89.69 with SMTP id bm5mr12177063wib.41.1404916849219; Wed, 09 Jul 2014 07:40:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.217.150.131 with HTTP; Wed, 9 Jul 2014 07:40:29 -0700 (PDT) From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Wed, 09 Jul 2014 14:40:00 -0000 Message-ID: Subject: Re: [RFC PATCH] -Wmemset-transposed-args (PR middle-end/61294) To: Gcc Patch List Cc: Richard Biener , Jason Merrill , Jakub Jelinek , "Joseph S. Myers" , Siddhesh Poyarekar , "Carlos O'Donell" , GNU C Library Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-07/txt/msg00628.txt.bz2 > All of these warnings (-Wsizeof-pointer-memaccess, -Wsizeof-array-argument > and -Wmemset-transposed-args) are implemented in a hackish way, because we > fold everything too early. Perhaps for such analysis we want a FOLDED_EXPR > which would have arguments what it has been folded to and the original tree, > for the purposes of code generation the first argument would be used and > the second one only for the analysis. We don't have that many spots where > we need the original trees to be analyzed yet for it to be worth it though > IMHO. But if we keep adding hacks around it, there will never be progress and the person(s) who take the challenge of properly fixing this will not only have to deal with the task itself but also with all the ugly and obscure hacks added year after year. Is it worth the trouble? Well, apart from those warnings that you mention, we have several bugs about it: See PR32643, PR60090. It prevents other desirable improvements: https://gcc.gnu.org/ml/gcc-patches/2012-09/msg01222.html It is mentioned as one of the "pros" of Clang vs. GCC: http://clang.llvm.org/comparison.html#gcc One of the main reasons why Clang was developed: https://www.youtube.com/watch?v=029YXzHtRy0#t=20m52s One of the reasons why Google switched to Clang: https://www.youtube.com/watch?v=NURiiQatBXA#t=4m09s And there has been a lot of work in this direction in the C FE that was never translated to the C++ FE: https://gcc.gnu.org/ml/gcc-patches/2008-10/msg01061.html Unfortunately, this is not the kind of work that a GSOC student or a volunteer can do on its free time. It requires a lot of experience and a continuous focused effort. Cheers, Manuel.