This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix unsafe function attributes for special functions (PR 71876)
On 07/21/16 00:19, Bernd Edlinger wrote:
> On 07/21/16 00:00, Jakub Jelinek wrote:
>> On Wed, Jul 20, 2016 at 09:50:03PM +0000, Bernd Edlinger wrote:
>>> But the built-in alloca is still recognized because the builtin
>>> does have ECF_MAY_BE_ALLOCA and ECF_MALLOC.
>> But __builtin_alloca_with_align likely doesn't have ECF_MALLOC set (even
>> when it should).
> DEF_BUILTIN_STUB (BUILT_IN_ALLOCA_WITH_ALIGN,
> do you know what the attributes are instead,
> or where that is constructed?
/* If we're checking the stack, `alloca' can throw. */
const int alloca_flags
= ECF_MALLOC | ECF_LEAF | (flag_stack_check ? 0 : ECF_NOTHROW);
if (!builtin_decl_explicit_p (BUILT_IN_ALLOCA))
ftype = build_function_type_list (ptr_type_node,
local_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
ftype = build_function_type_list (ptr_type_node, size_type_node,
local_define_builtin ("__builtin_alloca_with_align", ftype,
looks like ECF_MALLOC and ECF_LEAF are always there.