From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24705 invoked by alias); 21 Oct 2015 09:51:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 24689 invoked by uid 89); 21 Oct 2015 09:51:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f175.google.com Received: from mail-yk0-f175.google.com (HELO mail-yk0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 21 Oct 2015 09:51:47 +0000 Received: by ykaz22 with SMTP id z22so43659719yka.2 for ; Wed, 21 Oct 2015 02:51:45 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.125.194 with SMTP id y185mr5699721ywc.5.1445421105686; Wed, 21 Oct 2015 02:51:45 -0700 (PDT) Received: by 10.37.117.136 with HTTP; Wed, 21 Oct 2015 02:51:45 -0700 (PDT) In-Reply-To: <1514366.LKDlpZBPto@polaris> References: <1990513.tXxA4OvBVE@polaris> <56272531.8080609@redhat.com> <1514366.LKDlpZBPto@polaris> Date: Wed, 21 Oct 2015 09:56:00 -0000 Message-ID: Subject: Re: [patch] Fix failure of ACATS c45503c at -O2 From: Richard Biener To: Eric Botcazou Cc: Jeff Law , GCC Patches , Joseph Myers Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02049.txt.bz2 On Wed, Oct 21, 2015 at 9:24 AM, Eric Botcazou 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