diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-01-09 19:25:19 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-01-09 19:25:19 +0100 |
commit | e83b8e2e24490f634383aa882c6e39e3e6469fab (patch) | |
tree | 37c967d0243784a67a421818ebbbd738909d5f3c /gcc/tree.c | |
parent | b5f58ba3318e02aeaa60864fe9ae112f41b6d497 (diff) | |
download | gcc-e83b8e2e24490f634383aa882c6e39e3e6469fab.zip gcc-e83b8e2e24490f634383aa882c6e39e3e6469fab.tar.gz gcc-e83b8e2e24490f634383aa882c6e39e3e6469fab.tar.bz2 |
re PR target/58115 (testcase gcc.target/i386/intrinsics_4.c failure)
PR target/58115
* tree-core.h (struct target_globals): New forward declaration.
(struct tree_target_option): Add globals field.
* tree.h (TREE_TARGET_GLOBALS): Define.
(prepare_target_option_nodes_for_pch): New prototype.
* target-globals.h (struct target_globals): Define even if
!SWITCHABLE_TARGET.
* tree.c (prepare_target_option_node_for_pch,
prepare_target_option_nodes_for_pch): New functions.
* config/i386/i386.h (SWITCHABLE_TARGET): Define.
* config/i386/i386.c: Include target-globals.h.
(ix86_set_current_function): Instead of doing target_reinit
unconditionally, use save_target_globals_default_opts and
restore_target_globals.
c-family/
* c-pch.c (c_common_write_pch): Call
prepare_target_option_nodes_for_pch.
From-SVN: r206478
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -11527,6 +11527,28 @@ build_target_option_node (struct gcc_options *opts) return t; } +/* Reset TREE_TARGET_GLOBALS cache for TARGET_OPTION_NODE. + Called through htab_traverse. */ + +static int +prepare_target_option_node_for_pch (void **slot, void *) +{ + tree node = (tree) *slot; + if (TREE_CODE (node) == TARGET_OPTION_NODE) + TREE_TARGET_GLOBALS (node) = NULL; + return 1; +} + +/* Clear TREE_TARGET_GLOBALS of all TARGET_OPTION_NODE trees, + so that they aren't saved during PCH writing. */ + +void +prepare_target_option_nodes_for_pch (void) +{ + htab_traverse (cl_option_hash_table, prepare_target_option_node_for_pch, + NULL); +} + /* Determine the "ultimate origin" of a block. The block may be an inlined instance of an inlined instance of a block which is local to an inline function, so we have to trace all of the way back through the origin chain |