]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Fix up ix86_atomic_assign_expand_fenv [PR94780]
authorJakub Jelinek <jakub@redhat.com>
Mon, 27 Apr 2020 19:14:52 +0000 (21:14 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 16 Sep 2020 17:20:47 +0000 (19:20 +0200)
commit1777beb6b12983b946dae4177470a319693fc0dc
tree9eae6cfb229fb2d0b97e0fb46060b340bd53c7ab
parentd6a341eb9170fdb21aee235142d1f09e6dc5c5cd
x86: Fix up ix86_atomic_assign_expand_fenv [PR94780]

This function, because it is sometimes called even outside of function
bodies, uses create_tmp_var_raw rather than create_tmp_var.  But in order
for that to work, when first referenced, the VAR_DECLs need to appear in a
TARGET_EXPR so that during gimplification the var gets the right
DECL_CONTEXT and is added to local decls.  Without that, e.g. tree-nested.c
ICEs on those.

2020-04-27  Jakub Jelinek  <jakub@redhat.com>

PR target/94780
* config/i386/i386.c (ix86_atomic_assign_expand_fenv): Use
TARGET_EXPR instead of MODIFY_EXPR for first assignment to
sw_var, exceptions_var, mxcsr_orig_var and mxcsr_mod_var.

* gcc.dg/pr94780.c: New test.

(cherry picked from commit 9b8e9006bb35641865358e2df4f6b3ae185b239a)
gcc/config/i386/i386.c
gcc/testsuite/gcc.dg/pr94780.c [new file with mode: 0644]