From: Richard Biener <richard.guenther@gmail.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: Jeff Law <law@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>,
Joseph Myers <joseph@codesourcery.com>
Subject: Re: [patch] Fix failure of ACATS c45503c at -O2
Date: Wed, 21 Oct 2015 09:56:00 -0000 [thread overview]
Message-ID: <CAFiYyc3Ne8pLSYoOm6=8paXv6MUur8M0rdaUt4p8+-RkU+nw3Q@mail.gmail.com> (raw)
In-Reply-To: <1514366.LKDlpZBPto@polaris>
On Wed, Oct 21, 2015 at 9:24 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> So the only question is whether or not the CEIL_MOD_EXPR and
>> ROUND_MOD_EXPR bits are right. I'm confident the change to
>> FLOOR_MOD_EXPR is right.
>
> OK.
>
>> Do we have any reasonable way to test CEIL_MOD_EXPR & ROUND_MOD_EXPR?
>
> Note that the patch makes the function punt on those 2 so it can do no harm.
> The sign of CEIL_MOD_EXPR is predictable (opposite of that of the divisor) but
> you cannot use that in the context; and finally the sign of ROUND_MOD_EXPR
> isn't predictable.
>
> I can add a few more comments:
Maybe add the comments to tree.def instead.
> Index: fold-const.c
> ===================================================================
> --- fold-const.c (revision 229022)
> +++ fold-const.c (working copy)
> @@ -12982,11 +12982,18 @@ tree_binary_nonnegative_warnv_p (enum tr
> return RECURSE (op0) && RECURSE (op1);
>
> case TRUNC_MOD_EXPR:
> - case CEIL_MOD_EXPR:
> - case FLOOR_MOD_EXPR:
> - case ROUND_MOD_EXPR:
> + /* The sign of the remainder is that of the dividend. */
> return RECURSE (op0);
>
> + case FLOOR_MOD_EXPR:
> + /* The sign of the remainder is that of the divisor. */
> + return RECURSE (op1);
> +
> + case CEIL_MOD_EXPR:
> + /* The sign of the remainder is the opposite of that of the divisor,
> + but this cannot be used in this context. */
> + case ROUND_MOD_EXPR:
> + /* The sign of the remainder is not predictable. */
> default:
> return tree_simple_nonnegative_warnv_p (code, type);
> }
>
>
> --
> Eric Botcazou
next prev parent reply other threads:[~2015-10-21 9:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 16:38 Eric Botcazou
2015-10-20 19:04 ` Jeff Law
2015-10-20 22:10 ` Joseph Myers
2015-10-21 5:57 ` Jeff Law
2015-10-21 7:50 ` Eric Botcazou
2015-10-21 9:56 ` Richard Biener [this message]
2015-10-21 13:15 ` Eric Botcazou
2015-10-21 13:18 ` Richard Biener
2015-10-21 21:11 ` Richard Sandiford
2015-10-20 22:30 ` Eric Botcazou
2015-10-20 22:55 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFiYyc3Ne8pLSYoOm6=8paXv6MUur8M0rdaUt4p8+-RkU+nw3Q@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=law@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).