Enable experimental TSAN support for Ada.

2015-01-05  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Enable experimental TSAN support for Ada.
        * tsan.c (instrument_expr): Handle VIEW_CONVERT_EXPR.

From-SVN: r219197
This commit is contained in:
Bernd Edlinger 2015-01-05 20:26:44 +00:00 committed by Bernd Edlinger
parent 04a11c01de
commit 0d57824295
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2015-01-05 Bernd Edlinger <bernd.edlinger@hotmail.de>
Enable experimental TSAN support for Ada.
* tsan.c (instrument_expr): Handle VIEW_CONVERT_EXPR.
2015-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/64494

View File

@ -212,6 +212,17 @@ instrument_expr (gimple_stmt_iterator gsi, tree expr, bool is_write)
build_int_cst (TREE_TYPE (expr), bitpos / BITS_PER_UNIT));
expr_ptr = build_fold_addr_expr (expr);
}
/* We can't call build_fold_addr_expr on a VIEW_CONVERT_EXPR.
This can occur in Ada. */
else if (TREE_CODE (expr) == VIEW_CONVERT_EXPR)
{
align = get_object_alignment (expr);
if (align < BITS_PER_UNIT)
return false;
expr = TREE_OPERAND (expr, 0);
gcc_checking_assert (is_gimple_addressable (expr));
expr_ptr = build_fold_addr_expr (unshare_expr (expr));
}
else
{
align = get_object_alignment (expr);