This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Sep 2015 11:00:10 +0200
- Subject: Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1507241400450 dot 19642 at zhemvz dot fhfr dot qr> <8641521 dot JK1D07Utdj at polaris> <alpine dot LSU dot 2 dot 11 dot 1509141036321 dot 13444 at zhemvz dot fhfr dot qr>
> Still trying to reproduce, but I suppose you hit
The testcase fails as of r227729 on x86-64/Linux.
> /* Comparisons with the highest or lowest possible integer of
> the specified precision will have known values. */
> (simplify
> (cmp (convert?@2 @0) INTEGER_CST@1)
> (if ((INTEGRAL_TYPE_P (TREE_TYPE (@1)) || POINTER_TYPE_P (TREE_TYPE
> (@1)))
> && tree_nop_conversion_p (TREE_TYPE (@2), TREE_TYPE (@0)))
> (with
> {
> tree arg1_type = TREE_TYPE (@1);
> unsigned int prec = TYPE_PRECISION (arg1_type);
> wide_int max = wi::max_value (arg1_type);
> wide_int signed_max = wi::max_value (prec, SIGNED);
> wide_int min = wi::min_value (arg1_type);
> }
> (switch
> (if (wi::eq_p (@1, max))
> (switch
> (if (cmp == GT_EXPR)
> { constant_boolean_node (false, type); })
> (if (cmp == GE_EXPR)
> (eq @2 @1))
> (if (cmp == LE_EXPR)
> { constant_boolean_node (true, type); })
>
> this which should handle side-effects in @0 just fine:
>
> /* #line 2019 "/space/rguenther/src/svn/trunk/gcc/match.pd" */
> if (cmp == LE_EXPR)
> {
> if (dump_file && (dump_flags & TDF_DETAILS))
> fprintf (dump_file, "Applying pattern match.pd:2020, %s:%d\n", __FILE__,
> __LINE__);
> tree res;
> res = constant_boolean_node (true, type);
> if (TREE_SIDE_EFFECTS (captures[0]))
> res = build2_loc (loc, COMPOUND_EXPR, type,
> fold_ignored_result (captures[0]), res);
> return res;
>
> note that genmatch "inlines" omit_one_operand, so you only see
> fold_ignored_result here.
I see, then for some reason TREE_SIDE_EFFECTS is not set here.
--
Eric Botcazou