From 0317e5a24c41d619200b49d666e105525eae0bcc Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 13 Jun 2016 07:40:47 +0000 Subject: [PATCH] utils2.c (known_alignment): Deal specially with calls to malloc. * gcc-interface/utils2.c (known_alignment) : Deal specially with calls to malloc. From-SVN: r237356 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/utils2.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6f2fda6004b..41a6c619fe2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2016-06-13 Eric Botcazou + + * gcc-interface/utils2.c (known_alignment) : Deal specially + with calls to malloc. + 2016-06-11 Eric Botcazou * gcc-interface/trans.c (build_binary_op_trapv): If no operand is a diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index a0804e8e86d..aeb6cc3a3f7 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -171,6 +171,10 @@ known_alignment (tree exp) case CALL_EXPR: { + tree func = get_callee_fndecl (exp); + if (func && DECL_IS_MALLOC (func)) + return get_target_system_allocator_alignment () * BITS_PER_UNIT; + tree t = maybe_inline_call_in_expr (exp); if (t) return known_alignment (t); -- 2.30.2