[11/11] OpenMP/OpenACC: [WIP] Add gcc_unreachable to apparently-dead path in build_struct_comp_nodes

Message ID 8bca087d3bfa223fc8413e7b0cc7e5294dfe4b64.1633106213.git.julian@codesourcery.com
State New
Headers
Series OpenMP: Deep struct dereferences |

Commit Message

Julian Brown Oct. 1, 2021, 5:10 p.m. UTC
  The previous "not for committing" taxonomy patch shows that the path
handling "extra nodes" in build_struct_comp_nodes is probably now dead,
at least across the current testsuite.  This patch adds gcc_unreachable
on that path: this passes testing, which suggests that the extra node
handling can probably be removed completely.  (Otherwise we need test
coverage for that path, ideally!)

This is mostly posted as an FYI: a real patch would probably just remove
the unused code path, if it really isn't needed any more.

Thanks,

Julian

2021-09-29  Julian Brown  <julian@codesourcery.com>

gcc/
	* gimplify.c (build_struct_comp_nodes): Add gcc_unreachable on code
	path that appears to now be unused.
---
 gcc/gimplify.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d9fda21413d..3d444d1836f 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8625,6 +8625,9 @@  build_struct_comp_nodes (enum tree_code code, tree grp_start, tree grp_end,
       OMP_CLAUSE_SIZE (c3) = TYPE_SIZE_UNIT (ptr_type_node);
       OMP_CLAUSE_CHAIN (c3) = NULL_TREE;
 
+      /* Apparently?  */
+      gcc_unreachable ();
+
       *extra_node = c3;
     }
   else