> I think the better fix would be to only consider TREE_CONSTANT (arg) > if it wasn't constant initially. Because clearly "simplify" intends > to be "constant" here. In fact I wonder why we test !TREE_CONSTANT (arg) > at all, we don't simplify 'arg' ... > > Eric added this test (previosuly we'd just always done the folding), > but I think not enough?
Before my change we had always done the folding *only* for TREE_CONSTANT (arg) and my change allowed it for some cases of !TREE_CONSTANT (arg), but I did not want to touch the !TREE_CONSTANT (arg) case at all: * fold-const.c (fold_binary_op_with_conditional_arg): Do not restrict the folding to constants. Remove redundant final conversion. Tamar's issue appears to be for TREE_CONSTANT (arg) so orthogonal to mine. -- Eric Botcazou