__attribute__ ((alloc_size (1)))
__attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((noinline))
+alloc_func_long (long sz)
+{
+ return __builtin_malloc (sz);
+}
+
+void *
+__attribute__ ((alloc_size (1)))
+__attribute__ ((__nothrow__ , __leaf__))
+__attribute__ ((noinline))
alloc_func (size_t sz)
{
return __builtin_malloc (sz);
return ret;
}
+long
+__attribute__ ((noinline))
+test_builtin_malloc_long (long sz, long off)
+{
+ char *a = alloc_func_long (sz);
+ char *dest = a + off;
+ long ret = __builtin_dynamic_object_size (dest, 0);
+ return ret;
+}
+
/* Calloc-like allocator. */
size_t
FAIL ();
if (test_builtin_malloc_condphi5 (128, 0, argv[0]) != -1)
FAIL ();
+ long x = 42;
+ if (test_builtin_malloc_long (x, 0) != x)
+ FAIL ();
if (test_calloc (2048, 4) != 2048 * 4)
FAIL ();
if (test_builtin_calloc (2048, 8) != 2048 * 8)
else if (arg1 >= 0)
bytes = fold_convert (sizetype, gimple_call_arg (call, arg1));
- if (bytes)
- return STRIP_NOPS (bytes);
-
- return size_unknown (object_size_type);
+ return bytes ? bytes : size_unknown (object_size_type);
}