Mercurial > hg > CbC > CbC_gcc
diff gcc/tree-into-ssa.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/tree-into-ssa.c Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/tree-into-ssa.c Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ /* Rewrite a program in Normal form into SSA. - Copyright (C) 2001-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2018 Free Software Foundation, Inc. Contributed by Diego Novillo <dnovillo@redhat.com> This file is part of GCC. @@ -1463,7 +1463,8 @@ class rewrite_dom_walker : public dom_walker { public: - rewrite_dom_walker (cdi_direction direction) : dom_walker (direction) {} + rewrite_dom_walker (cdi_direction direction) + : dom_walker (direction, ALL_BLOCKS, NULL) {} virtual edge before_dom_children (basic_block); virtual void after_dom_children (basic_block); @@ -2153,7 +2154,8 @@ class rewrite_update_dom_walker : public dom_walker { public: - rewrite_update_dom_walker (cdi_direction direction) : dom_walker (direction) {} + rewrite_update_dom_walker (cdi_direction direction) + : dom_walker (direction, ALL_BLOCKS, NULL) {} virtual edge before_dom_children (basic_block); virtual void after_dom_children (basic_block); @@ -2322,7 +2324,7 @@ }; mark_def_dom_walker::mark_def_dom_walker (cdi_direction direction) - : dom_walker (direction), m_kills (BITMAP_ALLOC (NULL)) + : dom_walker (direction, ALL_BLOCKS, NULL), m_kills (BITMAP_ALLOC (NULL)) { } @@ -2488,6 +2490,28 @@ SET_SSA_NAME_VAR_OR_IDENTIFIER (name, DECL_NAME (decl)); } + /* Initialize SSA_NAME_POINTS_TO_READONLY_MEMORY. */ + tree fnspec = lookup_attribute ("fn spec", + TYPE_ATTRIBUTES (TREE_TYPE (fun->decl))); + if (fnspec) + { + fnspec = TREE_VALUE (TREE_VALUE (fnspec)); + unsigned i = 1; + for (tree arg = DECL_ARGUMENTS (cfun->decl); + arg; arg = DECL_CHAIN (arg), ++i) + { + if (i >= (unsigned) TREE_STRING_LENGTH (fnspec)) + break; + if (TREE_STRING_POINTER (fnspec)[i] == 'R' + || TREE_STRING_POINTER (fnspec)[i] == 'r') + { + tree name = ssa_default_def (fun, arg); + if (name) + SSA_NAME_POINTS_TO_READONLY_MEMORY (name) = 1; + } + } + } + return 0; }