From: Richard Guenther Date: Thu, 3 Nov 2005 09:30:12 +0000 (+0000) Subject: re PR middle-end/24470 (segmentation fault in cc1plus when compiling with -O) X-Git-Tag: releases/gcc-3.4.5~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67b9f6cba6f8d5062c9a90c1922525ee14380bad;p=thirdparty%2Fgcc.git re PR middle-end/24470 (segmentation fault in cc1plus when compiling with -O) 2005-11-03 Richard Guenther PR middle-end/24470 * fold-const.c (fold): Avoid running in circles if we got some un-folded subtree. From-SVN: r106426 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57f6747c8ed4..96d584fc0df5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-11-03 Richard Guenther + + PR middle-end/24470 + * fold-const.c (fold): Avoid running in circles if we + got some un-folded subtree. + 2005-10-30 Alan Modra PR target/23070 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ba9031b705e9..d786292bff86 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8142,7 +8142,12 @@ fold (tree expr) if (INTEGRAL_TYPE_P (type) && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST - && TREE_CODE (arg2) == INTEGER_CST) + && TREE_CODE (arg2) == INTEGER_CST + /* ??? We somehow can end up here with + (unsigned int)1 == 1 ? 1U : 2U + for which we won't make any progress but recurse + indefinitely. Just stop here in this case. */ + && TREE_CODE (arg1) != INTEGER_CST) switch (comp_code) { case EQ_EXPR: