PR middle-end/58551
	* tree-cfg.c (move_sese_region_to_fn): Also move loops that
	are children of outermost saved_cfun's loop, and set it up to
	be moved to dest_cfun's outermost loop.  Fix up num_nodes adjustments
	if loop != loop0 and SESE region contains bbs that belong to loop0.

	* c-c++-common/gomp/pr58551.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202972 138bc75d-0d04-0410-961f-82ee72b054a4