Hello Florian,

Let's CC Jason for this optimization patch.

Florian Weimer <fwei...@redhat.com> 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 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_TREE;
+           {
+             cookie_size = NULL_TREE;
+             /* No size arithmetic necessary, so the size check is
+                not needed. */
+             if (outer_nelts_check != NULL && inner_size == double_int_one)
+               outer_nelts_check = NULL_TREE;
+           }

I couldn't find where in code is TYPE_VEC_NEW_USES_COOKIE is set.  Is it
still used?

-- 
                Dodji

Reply via email to