From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30560 invoked by alias); 12 Dec 2014 09:37:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30535 invoked by uid 48); 12 Dec 2014 09:37:23 -0000 From: "ktkachov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64274] [5.0 Regression][ARM] gcc.target/arm/fixed-point-exec.c ICE in fold_binary_loc Date: Fri, 12 Dec 2014 09:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ktkachov at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg01373.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64274 --- Comment #2 from ktkachov at gcc dot gnu.org --- (In reply to Marek Polacek from comment #1) > Does the following fix it? > > diff --git a/gcc/fold-const.c b/gcc/fold-const.c > index 7b68bea..34f5a6b 100644 > --- a/gcc/fold-const.c > +++ b/gcc/fold-const.c > @@ -10082,7 +10082,8 @@ fold_binary_loc (location_t loc, > /* Reassociate (plus (plus (mult) (foo)) (mult)) as > (plus (plus (mult) (mult)) (foo)) so that we can > take advantage of the factoring cases below. */ > - if (TYPE_OVERFLOW_WRAPS (type) > + if (ANY_INTEGRAL_TYPE_P (type) > + && TYPE_OVERFLOW_WRAPS (type) > && (((TREE_CODE (arg0) == PLUS_EXPR > || TREE_CODE (arg0) == MINUS_EXPR) > && TREE_CODE (arg1) == MULT_EXPR) Yes, thanks. I'll bootstrap this on arm-none-linux-gnueabihf it you'd like