public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Carlini <paolo.carlini@oracle.com>
To: Marc Glisse <marc.glisse@inria.fr>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: calloc = malloc + memset
Date: Sat, 01 Mar 2014 12:26:00 -0000	[thread overview]
Message-ID: <9A4E350E-8379-4F1D-ABA1-00AFEC9B82A5@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402282337290.27023@stedding.saclay.inria.fr>

Hi

> On 28/feb/2014, at 23:48, Marc Glisse <marc.glisse@inria.fr> wrote:
> 
> Hello,
> 
> this is a stage 1 patch, and I'll ping it then, but if you have comments now...
> 
> Passes bootstrap+testsuite on x86_64-linux-gnu.
> 
> 2014-02-28  Marc Glisse  <marc.glisse@inria.fr>
> 
>    PR tree-optimization/57742
> gcc/
>    * tree-ssa-forwprop.c (simplify_malloc_memset): New function.
>    (simplify_builtin_call): Call it.
> gcc/testsuite/
>    * g++.dg/tree-ssa/calloc.C: New testcase.
>    * gcc.dg/tree-ssa/calloc.c: Likewise.
> 
> -- 
> Marc Glisse
> Index: gcc/testsuite/g++.dg/tree-ssa/calloc.C
> ===================================================================
> --- gcc/testsuite/g++.dg/tree-ssa/calloc.C    (revision 0)
> +++ gcc/testsuite/g++.dg/tree-ssa/calloc.C    (working copy)
> @@ -0,0 +1,35 @@
> +/* { dg-do compile } */
> +/* { dg-options "-std=gnu++11 -O3 -fdump-tree-optimized" } */
> +
> +#include <new>
> +#include <vector>
> +#include <cstdlib>
> +
> +void g(void*);
> +inline void* operator new(std::size_t sz) _GLIBCXX_THROW (std::bad_alloc)

Unless *really* necessary I would recommend not including the large <vector> (that also couples quite seriously the front-end testsuite to the library testsuite, we already discussed those topics in the past). Using the internal macros seems also unnecessary.

Paolo

  reply	other threads:[~2014-03-01 12:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 22:48 Marc Glisse
2014-03-01 12:26 ` Paolo Carlini [this message]
2014-03-01 14:51   ` Marc Glisse
2014-03-03  9:50 ` Richard Biener
2014-03-03 13:45   ` Marc Glisse
2014-03-23 19:47   ` Marc Glisse
2014-04-15 19:06     ` Marc Glisse
2014-04-18 11:31     ` Jakub Jelinek
2014-04-18 18:34       ` Marc Glisse
2014-04-23 14:05         ` Richard Biener
2014-05-17 14:19           ` Marc Glisse
2014-06-03 14:00             ` Marc Glisse
2014-06-23  7:32               ` Jakub Jelinek
2014-06-23 15:52                 ` Marc Glisse
2014-06-23 16:11                   ` Richard Biener
2014-06-23 16:19                     ` Marc Glisse
2014-06-23 16:45                       ` Richard Biener
2014-06-23 18:20 ` Andi Kleen
2014-06-23 18:51   ` Andrew Pinski
2014-06-23 19:00   ` Marc Glisse
2014-06-23 19:37     ` Andi Kleen
2014-06-23 20:14       ` Marc Glisse
2014-06-23 20:21         ` Andi Kleen
2014-06-23 20:25           ` Andrew Pinski
2014-07-15 12:38 ` Bernd Schmidt
2014-07-15 13:15   ` Richard Biener

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=9A4E350E-8379-4F1D-ABA1-00AFEC9B82A5@oracle.com \
    --to=paolo.carlini@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marc.glisse@inria.fr \
    /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).