Re: [C++] Omit overflow check for new char[n]

2012-11-06 Thread Jason Merrill
OK. Jason

Re: [C++] Omit overflow check for new char[n]

2012-10-31 Thread Florian Weimer
On 10/31/2012 06:13 PM, Florian Weimer wrote: + if (outer_nelts_check != NULL && inner_size.is_one()) Uhm, I will add the missing space before commit. Sorry. -- Florian Weimer / Red Hat Product Security Team

Re: [C++] Omit overflow check for new char[n]

2012-10-31 Thread Florian Weimer
On 10/31/2012 10:05 AM, Jakub Jelinek wrote: I don't see any == double_int_one (or zero) comparisons in grep, so I'd say inner_size.is_one () should be used instead (which is used pretty frequently). Ditto in the second spot. Otherwise the patch looks good to me, but I'd like Jason to chime in

Re: [C++] Omit overflow check for new char[n]

2012-10-31 Thread Jakub Jelinek
On Mon, Oct 08, 2012 at 05:50:34PM +0200, Florian Weimer wrote: > gcc/: > > 2012-10-08 Florian Weimer > > * init.c (build_new_1): Do not check for arithmetic overflow if > inner array size is 1. > > gcc/testsuite/: > > 2012-10-08 Florian Weimer > > * g++.dg/init/new40.C

Re: [C++] Omit overflow check for new char[n]

2012-10-11 Thread Dodji Seketeli
Florian Weimer a écrit: > On 10/10/2012 06:02 PM, Dodji Seketeli wrote: > >> I just have one question for own education. >> >> Regarding: >> >> @@ -2450,7 +2450,13 @@ >>if (array_p && TYPE_VEC_NEW_USES_COOKIE (elt_type)) >> size = size_binop (PLUS_EXPR, size, cookie_size); >>

Re: [C++] Omit overflow check for new char[n]

2012-10-10 Thread Florian Weimer
On 10/10/2012 06:02 PM, Dodji Seketeli wrote: I just have one question for own education. Regarding: @@ -2450,7 +2450,13 @@ if (array_p && TYPE_VEC_NEW_USES_COOKIE (elt_type)) size = size_binop (PLUS_EXPR, size, cookie_size); else - cookie_size = NULL_

Re: [C++] Omit overflow check for new char[n]

2012-10-10 Thread Dodji Seketeli
Hello Florian, Let's CC Jason for this optimization patch. Florian Weimer a écrit: > If the size of the inner array elements is 1 and we do not need a > cookie, we do not need to insert an overflow check. This applies to > the relatively frequent new char[n] case. I just have one question for

[C++] Omit overflow check for new char[n]

2012-10-08 Thread Florian Weimer
If the size of the inner array elements is 1 and we do not need a cookie, we do not need to insert an overflow check. This applies to the relatively frequent new char[n] case. Built and regression-tested on x86_64-redhat-linux-gnu. Okay for trunk? -- Florian Weimer / Red Hat Product Security