public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
To: Gcc Patch List <gcc-patches@gcc.gnu.org>
Cc: Richard Biener <richard.guenther@gmail.com>,
	Jason Merrill <jason@redhat.com>,
		Jakub Jelinek <jakub@redhat.com>,
	"Joseph S. Myers" <joseph@codesourcery.com>,
		Siddhesh Poyarekar <siddhesh@redhat.com>,
	"Carlos O'Donell" <carlos@redhat.com>,
		GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [RFC PATCH] -Wmemset-transposed-args (PR middle-end/61294)
Date: Wed, 09 Jul 2014 14:40:00 -0000	[thread overview]
Message-ID: <CAESRpQDeicuneH9VGgCEhUNz3Kfn3EAJa+JO64iqLoHH9xgbpA@mail.gmail.com> (raw)

> 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.

             reply	other threads:[~2014-07-09 14:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 14:40 Manuel López-Ibáñez [this message]
2014-07-09 21:28 ` Jason Merrill
2014-07-10 12:52   ` [PATCH] -Wmemset-transposed-args (PR middle-end/61294, take 2) Jakub Jelinek
2014-07-10 17:57     ` Jason Merrill
2014-07-10 23:29     ` Gerald Pfeifer
2014-07-11 20:19       ` Jakub Jelinek
2015-04-12 19:30         ` Gerald Pfeifer
  -- strict thread matches above, loose matches on Subject: below --
2014-07-08 12:50 [RFC PATCH] -Wmemset-transposed-args (PR middle-end/61294) Jakub Jelinek
2014-07-08 19:25 ` Jason Merrill
2014-07-08 19:38   ` Carlos O'Donell
2014-07-08 20:32   ` Jakub Jelinek
2014-07-08 22:33     ` Jason Merrill
2014-07-09 10:26       ` Richard Biener
2014-07-09 10:33         ` Jakub Jelinek
2014-07-09 10:51           ` Richard Biener
2014-07-09 11:09             ` Jakub Jelinek
2014-07-08 19:34 ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAESRpQDeicuneH9VGgCEhUNz3Kfn3EAJa+JO64iqLoHH9xgbpA@mail.gmail.com \
    --to=lopezibanez@gmail.com \
    --cc=carlos@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=richard.guenther@gmail.com \
    --cc=siddhesh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).