Commit 67fafdd1 by Aldy Hernandez Committed by Aldy Hernandez

tree.c (build_common_builtin_nodes): Do not use TM_PURE attribute unless…

tree.c (build_common_builtin_nodes): Do not use TM_PURE attribute unless language has support for TM.

        PR/51291
        * tree.c (build_common_builtin_nodes): Do not use TM_PURE
        attribute unless language has support for TM.
        * config/i386/i386.c (ix86_init_tm_builtins): Exit gracefully in
        the absence of TM builtins.

From-SVN: r182179
parent 8f420307
2011-12-09 Aldy Hernandez <aldyh@redhat.com>
PR/51291
* tree.c (build_common_builtin_nodes): Do not use TM_PURE
attribute unless language has support for TM.
* config/i386/i386.c (ix86_init_tm_builtins): Exit gracefully in
the absence of TM builtins.
2011-12-09 Eric Botcazou <ebotcazou@adacore.com> 2011-12-09 Eric Botcazou <ebotcazou@adacore.com>
* gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>: * gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>:
...@@ -27023,6 +27023,11 @@ ix86_init_tm_builtins (void) ...@@ -27023,6 +27023,11 @@ ix86_init_tm_builtins (void)
if (!flag_tm) if (!flag_tm)
return; return;
/* If there are no builtins defined, we must be compiling in a
language without trans-mem support. */
if (!builtin_decl_explicit_p (BUILT_IN_TM_LOAD_1))
return;
/* Use whatever attributes a normal TM load has. */ /* Use whatever attributes a normal TM load has. */
decl = builtin_decl_explicit (BUILT_IN_TM_LOAD_1); decl = builtin_decl_explicit (BUILT_IN_TM_LOAD_1);
attrs_load = DECL_ATTRIBUTES (decl); attrs_load = DECL_ATTRIBUTES (decl);
! { dg-do compile }
! { dg-options "-fgnu-tm" }
program foo
real x
end program foo
...@@ -9437,6 +9437,7 @@ void ...@@ -9437,6 +9437,7 @@ void
build_common_builtin_nodes (void) build_common_builtin_nodes (void)
{ {
tree tmp, ftype; tree tmp, ftype;
int ecf_flags;
if (!builtin_decl_explicit_p (BUILT_IN_MEMCPY) if (!builtin_decl_explicit_p (BUILT_IN_MEMCPY)
|| !builtin_decl_explicit_p (BUILT_IN_MEMMOVE)) || !builtin_decl_explicit_p (BUILT_IN_MEMMOVE))
...@@ -9589,9 +9590,12 @@ build_common_builtin_nodes (void) ...@@ -9589,9 +9590,12 @@ build_common_builtin_nodes (void)
its value in the landing pad. */ its value in the landing pad. */
ftype = build_function_type_list (ptr_type_node, ftype = build_function_type_list (ptr_type_node,
integer_type_node, NULL_TREE); integer_type_node, NULL_TREE);
ecf_flags = ECF_PURE | ECF_NOTHROW | ECF_LEAF;
/* Only use TM_PURE if we we have TM language support. */
if (builtin_decl_explicit_p (BUILT_IN_TM_LOAD_1))
ecf_flags |= ECF_TM_PURE;
local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER, local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER,
"__builtin_eh_pointer", "__builtin_eh_pointer", ecf_flags);
ECF_PURE | ECF_NOTHROW | ECF_LEAF | ECF_TM_PURE);
tmp = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0); tmp = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0);
ftype = build_function_type_list (tmp, integer_type_node, NULL_TREE); ftype = build_function_type_list (tmp, integer_type_node, NULL_TREE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment