diff options
author | Martin Sebor <msebor@redhat.com> | 2017-03-14 22:16:27 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-03-14 16:16:27 -0600 |
commit | 5d9a283ac6aaa10d7f1052dba4cde7a8a63c88fc (patch) | |
tree | f36c32b1806b1bccfa8cb3918937f113e48bffd9 /gcc/builtin-attrs.def | |
parent | 6bf29a7e402c9650a0feeb00038f873adc7cd309 (diff) | |
download | gcc-5d9a283ac6aaa10d7f1052dba4cde7a8a63c88fc.zip gcc-5d9a283ac6aaa10d7f1052dba4cde7a8a63c88fc.tar.gz gcc-5d9a283ac6aaa10d7f1052dba4cde7a8a63c88fc.tar.bz2 |
re PR middle-end/80020 (gcc confused about aligned_alloc argument order)
PR middle-end/80020
* builtin-attrs.def (ATTR_ALLOC_SIZE_2_NOTHROW_LIST): New macro.
* builtins.def (aligned_alloc): Use it.
PR middle-end/80020
* gcc.dg/attr-alloc_size-6.c: Correct aligned_alloc argument order.
* gcc.dg/attr-alloc_size-7.c: Same.
* gcc.dg/attr-alloc_size-9.c: Same.
* gcc.dg/builtin-alloc-size.c: Same.
* gcc.dg/pr80020.c: New test.
From-SVN: r246145
Diffstat (limited to 'gcc/builtin-attrs.def')
-rw-r--r-- | gcc/builtin-attrs.def | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def index 2753288..38fb1bb 100644 --- a/gcc/builtin-attrs.def +++ b/gcc/builtin-attrs.def @@ -156,9 +156,12 @@ DEF_ATTR_TREE_LIST (ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST, ATTR_CONST,\ ATTR_NULL, ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST) /* Allocation functions like malloc and realloc whose first argument - specifies the size of the allocated object. */ + with _SIZE_1, or second argument with _SIZE_2, specifies the size + of the allocated object. */ DEF_ATTR_TREE_LIST (ATTR_MALLOC_SIZE_1_NOTHROW_LIST, ATTR_ALLOC_SIZE, \ ATTR_LIST_1, ATTR_MALLOC_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_ALLOC_SIZE_2_NOTHROW_LIST, ATTR_ALLOC_SIZE, \ + ATTR_LIST_2, ATTR_MALLOC_NOTHROW_LIST) DEF_ATTR_TREE_LIST (ATTR_MALLOC_SIZE_1_NOTHROW_LEAF_LIST, ATTR_ALLOC_SIZE, \ ATTR_LIST_1, ATTR_MALLOC_NOTHROW_LEAF_LIST) /* Alloca is just like malloc except that it never returns null. */ |