utils2.c (known_alignment): Deal specially with calls to malloc.

* gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Deal specially
	with calls to malloc.

From-SVN: r237356
This commit is contained in:
Eric Botcazou 2016-06-13 07:40:47 +00:00 committed by Eric Botcazou
parent f57f53d3a5
commit 0317e5a24c
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Deal specially
with calls to malloc.
2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (build_binary_op_trapv): If no operand is a

View File

@ -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);