------- Comment #2 from rguenth at gcc dot gnu dot org 2009-08-12 13:36 ------- We take a lot of time and memory in
/* Convert (T1)(X * Y) into (T1)X * (T1)Y if T1 is narrower than the type of X and Y (integer types only). */ if (INTEGRAL_TYPE_P (type) && TREE_CODE (op0) == MULT_EXPR && INTEGRAL_TYPE_P (TREE_TYPE (op0)) && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (op0))) { ... tem = fold_build2 (MULT_EXPR, mult_type, fold_convert (mult_type, TREE_OPERAND (op0, 0)), fold_convert (mult_type, TREE_OPERAND (op0, 1))); building ((((character(kind=4)) i_1(D) * (character(kind=4)) i_1(D)) * (character(kind=4)) i_1(D)) * ((((character(kind=4)) i_1(D) * ... from (character(kind=4)) (((((integer(kind=8)) i_1(D) * ((integer(kind=8)) i_1(D) * (integer(kind=8)) i_1(D))) * (((integer(kind=8)) i_1(D) * ((integer(kind=8)) i_1(D) * (integer(kind=8)) i_1(D))) * ... appearantly something odd happens as that above transformation should take linear time only. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41043