From 68ea7618de28a52f5a8db9850f162614c8a0c4b5 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 6 Oct 2015 09:14:48 +0000 Subject: [PATCH] re PR c/65345 (ICE with _Generic selection on _Atomic int) PR c/65345 * config/sparc/sparc.c (sparc_atomic_assign_expand_fenv): Adjust to use create_tmp_var_raw rather than create_tmp_var. From-SVN: r228516 --- gcc/ChangeLog | 6 ++++++ gcc/config/sparc/sparc.c | 25 +++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c59c1ea363..2e6697d285d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-06 Eric Botcazou + + PR c/65345 + * config/sparc/sparc.c (sparc_atomic_assign_expand_fenv): Adjust to + use create_tmp_var_raw rather than create_tmp_var. + 2015-10-06 Richard Biener * tree-vectorizer.h (vec_info): New base class for... diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index a0adf2295a3..d9c5c665436 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -12540,20 +12540,23 @@ sparc_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) __builtin_load_fsr (&tmp1_var); */ - tree fenv_var = create_tmp_var (unsigned_type_node); - mark_addressable (fenv_var); + tree fenv_var = create_tmp_var_raw (unsigned_type_node); + TREE_ADDRESSABLE (fenv_var) = 1; tree fenv_addr = build_fold_addr_expr (fenv_var); tree stfsr = sparc_builtins[SPARC_BUILTIN_STFSR]; - tree hold_stfsr = build_call_expr (stfsr, 1, fenv_addr); + tree hold_stfsr + = build4 (TARGET_EXPR, unsigned_type_node, fenv_var, + build_call_expr (stfsr, 1, fenv_addr), NULL_TREE, NULL_TREE); - tree tmp1_var = create_tmp_var (unsigned_type_node); - mark_addressable (tmp1_var); + tree tmp1_var = create_tmp_var_raw (unsigned_type_node); + TREE_ADDRESSABLE (tmp1_var) = 1; tree masked_fenv_var = build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var, build_int_cst (unsigned_type_node, ~(accrued_exception_mask | trap_enable_mask))); tree hold_mask - = build2 (MODIFY_EXPR, void_type_node, tmp1_var, masked_fenv_var); + = build4 (TARGET_EXPR, unsigned_type_node, tmp1_var, masked_fenv_var, + NULL_TREE, NULL_TREE); tree tmp1_addr = build_fold_addr_expr (tmp1_var); tree ldfsr = sparc_builtins[SPARC_BUILTIN_LDFSR]; @@ -12578,10 +12581,12 @@ sparc_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) tmp2_var >>= 5; __atomic_feraiseexcept ((int) tmp2_var); */ - tree tmp2_var = create_tmp_var (unsigned_type_node); - mark_addressable (tmp2_var); - tree tmp3_addr = build_fold_addr_expr (tmp2_var); - tree update_stfsr = build_call_expr (stfsr, 1, tmp3_addr); + tree tmp2_var = create_tmp_var_raw (unsigned_type_node); + TREE_ADDRESSABLE (tmp2_var) = 1; + tree tmp2_addr = build_fold_addr_expr (tmp2_var); + tree update_stfsr + = build4 (TARGET_EXPR, unsigned_type_node, tmp2_var, + build_call_expr (stfsr, 1, tmp2_addr), NULL_TREE, NULL_TREE); tree update_ldfsr = build_call_expr (ldfsr, 1, fenv_addr); -- 2.30.2