https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125154
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |compile-time-hog, openmp
Ever confirmed|0 |1
Priority|P3 |P4
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-05-13
--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.
Added openmp only because it is required at compile time for the infinite
loop to occur. Please adjust keywords if deemed necessary.
The infinite loop occurs probably here (after ^C in gdb):
0 0x0000000001036cd1 in mostly_copy_tree_r (tp=0x7fff4a7b4858,
walk_subtrees=0x7fffffaf200c, data=0x0) at
../../gcc-trunk/gcc/gimplify.cc:946
#1 0x000000000181956d in walk_tree_1 (tp=0x7fff4a7b4858,
func=func@entry=0x1036cc0 <mostly_copy_tree_r(tree*, int*, void*)>,
data=data@entry=0x0, pset=pset@entry=0x0, lh=lh@entry=0x0)
at ../../gcc-trunk/gcc/tree.cc:11742
#2 0x00000000018196ac in walk_tree_1 (tp=<optimized out>,
func=func@entry=0x1036cc0 <mostly_copy_tree_r(tree*, int*, void*)>,
data=data@entry=0x0, pset=pset@entry=0x0, lh=lh@entry=0x0)
at ../../gcc-trunk/gcc/tree.cc:11979
...
(gdb) l
11974 /* Go through the subtrees. We need to do this in forward
order so
11975 that the scope of a FOR_EXPR is handled properly. */
11976 if (len)
11977 {
11978 for (i = 0; i < len - 1; ++i)
11979 WALK_SUBTREE (TREE_OPERAND (t, i));
11980 WALK_SUBTREE_TAIL (TREE_OPERAND (t, len - 1));
11981 }
11982 }
11983 /* If this is a type, walk the needed fields in the type. */
11737 if (pset && pset->add (*tp))
11738 return NULL_TREE;
11739
11740 /* Call the function. */
11741 int walk_subtrees = 1;
11742 tree result = (*func) (tp, &walk_subtrees, data);
11743
11744 /* If we found something, return it. */
11745 if (result)
11746 return result;
(gdb) l gimplify.cc:946
941 set that is used to unshare the subtrees of these nodes. */
942
943 static tree
944 mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data)
945 {
946 tree t = *tp;
947 enum tree_code code = TREE_CODE (t);
948
949 /* Do not copy SAVE_EXPR, TARGET_EXPR or BIND_EXPR nodes themselves,
but
950 copy their subtrees if we can make sure to do it only once. */