This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Fix up file-scope _Atomic expansion (PR c/65345)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 20 Mar 2015 17:12:17 +0000
- Subject: Re: [C PATCH] Fix up file-scope _Atomic expansion (PR c/65345)
- Authentication-results: sourceware.org; auth=none
- References: <20150312173748 dot GQ26802 at redhat dot com>
On Thu, 12 Mar 2015, Marek Polacek wrote:
> 2015-03-12 Marek Polacek <polacek@redhat.com>
>
> PR c/65345
> * c-decl.c (set_labels_context_r): New function.
> (store_parm_decls): Call it via walk_tree_without_duplicates.
> * c-typeck.c (convert_lvalue_to_rvalue): Use create_tmp_var_raw
> instead of create_tmp_var. Build TARGET_EXPR instead of
> COMPOUND_EXPR.
> (build_atomic_assign): Use create_tmp_var_raw instead of
> create_tmp_var. Build TARGET_EXPRs instead of MODIFY_EXPR.
>
> * gcc.dg/pr65345-1.c: New test.
> * gcc.dg/pr65345-2.c: New test.
OK for stage 1, but I think you may need a further patch that fixes the
TARGET_ATOMIC_ASSIGN_EXPAND_FENV implementations to use create_tmp_var_raw
and TARGET_EXPR as well, along with adding tests for floating-point
compound assignment / increment / decrement in the problem contexts. A
backport to GCC 5 branch could be considered after a while on trunk.
--
Joseph S. Myers
joseph@codesourcery.com