comparison 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
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Rewrite a program in Normal form into SSA. 1 /* Rewrite a program in Normal form into SSA.
2 Copyright (C) 2001-2017 Free Software Foundation, Inc. 2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 Contributed by Diego Novillo <dnovillo@redhat.com> 3 Contributed by Diego Novillo <dnovillo@redhat.com>
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
1461 } 1461 }
1462 1462
1463 class rewrite_dom_walker : public dom_walker 1463 class rewrite_dom_walker : public dom_walker
1464 { 1464 {
1465 public: 1465 public:
1466 rewrite_dom_walker (cdi_direction direction) : dom_walker (direction) {} 1466 rewrite_dom_walker (cdi_direction direction)
1467 : dom_walker (direction, ALL_BLOCKS, NULL) {}
1467 1468
1468 virtual edge before_dom_children (basic_block); 1469 virtual edge before_dom_children (basic_block);
1469 virtual void after_dom_children (basic_block); 1470 virtual void after_dom_children (basic_block);
1470 }; 1471 };
1471 1472
2151 } 2152 }
2152 2153
2153 class rewrite_update_dom_walker : public dom_walker 2154 class rewrite_update_dom_walker : public dom_walker
2154 { 2155 {
2155 public: 2156 public:
2156 rewrite_update_dom_walker (cdi_direction direction) : dom_walker (direction) {} 2157 rewrite_update_dom_walker (cdi_direction direction)
2158 : dom_walker (direction, ALL_BLOCKS, NULL) {}
2157 2159
2158 virtual edge before_dom_children (basic_block); 2160 virtual edge before_dom_children (basic_block);
2159 virtual void after_dom_children (basic_block); 2161 virtual void after_dom_children (basic_block);
2160 }; 2162 };
2161 2163
2320 function, not just the ones we are renaming. */ 2322 function, not just the ones we are renaming. */
2321 bitmap m_kills; 2323 bitmap m_kills;
2322 }; 2324 };
2323 2325
2324 mark_def_dom_walker::mark_def_dom_walker (cdi_direction direction) 2326 mark_def_dom_walker::mark_def_dom_walker (cdi_direction direction)
2325 : dom_walker (direction), m_kills (BITMAP_ALLOC (NULL)) 2327 : dom_walker (direction, ALL_BLOCKS, NULL), m_kills (BITMAP_ALLOC (NULL))
2326 { 2328 {
2327 } 2329 }
2328 2330
2329 mark_def_dom_walker::~mark_def_dom_walker () 2331 mark_def_dom_walker::~mark_def_dom_walker ()
2330 { 2332 {
2484 if (decl 2486 if (decl
2485 && VAR_P (decl) 2487 && VAR_P (decl)
2486 && !VAR_DECL_IS_VIRTUAL_OPERAND (decl) 2488 && !VAR_DECL_IS_VIRTUAL_OPERAND (decl)
2487 && DECL_IGNORED_P (decl)) 2489 && DECL_IGNORED_P (decl))
2488 SET_SSA_NAME_VAR_OR_IDENTIFIER (name, DECL_NAME (decl)); 2490 SET_SSA_NAME_VAR_OR_IDENTIFIER (name, DECL_NAME (decl));
2491 }
2492
2493 /* Initialize SSA_NAME_POINTS_TO_READONLY_MEMORY. */
2494 tree fnspec = lookup_attribute ("fn spec",
2495 TYPE_ATTRIBUTES (TREE_TYPE (fun->decl)));
2496 if (fnspec)
2497 {
2498 fnspec = TREE_VALUE (TREE_VALUE (fnspec));
2499 unsigned i = 1;
2500 for (tree arg = DECL_ARGUMENTS (cfun->decl);
2501 arg; arg = DECL_CHAIN (arg), ++i)
2502 {
2503 if (i >= (unsigned) TREE_STRING_LENGTH (fnspec))
2504 break;
2505 if (TREE_STRING_POINTER (fnspec)[i] == 'R'
2506 || TREE_STRING_POINTER (fnspec)[i] == 'r')
2507 {
2508 tree name = ssa_default_def (fun, arg);
2509 if (name)
2510 SSA_NAME_POINTS_TO_READONLY_MEMORY (name) = 1;
2511 }
2512 }
2489 } 2513 }
2490 2514
2491 return 0; 2515 return 0;
2492 } 2516 }
2493 2517