From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90550 invoked by alias); 12 Jul 2017 21:21:20 -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 90529 invoked by uid 89); 12 Jul 2017 21:21:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=bills, 07am, 07AM, Bills X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Jul 2017 21:21:18 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v6CLLCGb027265; Wed, 12 Jul 2017 16:21:13 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id v6CLLAvC027264; Wed, 12 Jul 2017 16:21:10 -0500 Date: Wed, 12 Jul 2017 21:21:00 -0000 From: Segher Boessenkool To: Will Schmidt Cc: GCC Patches , Bill Schmidt , David Edelsohn Subject: Re: [PATCH, rs6000] Do not do gimple-folding of expressions that are missing their LHS Message-ID: <20170712212109.GS13471@gate.crashing.org> References: <1499877907.24125.400.camel@brimstone.rchland.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1499877907.24125.400.camel@brimstone.rchland.ibm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00619.txt.bz2 On Wed, Jul 12, 2017 at 11:45:07AM -0500, Will Schmidt wrote: > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index 10c5521..e21b56f 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -16297,6 +16297,9 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi) > = (enum rs6000_builtins) DECL_FUNCTION_CODE (fndecl); > tree arg0, arg1, lhs; > > + /* Generic solution to prevent gimple folding of code without a LHS. */ Only one space after /* please. > + if (!gimple_call_lhs (stmt)) return false; I know I typed that code, but "return" should be on a new line, indented. Sorry :-) > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-missing-lhs.c > @@ -0,0 +1,24 @@ > +/* This test is meant to verify that the gimple-folding does not > +occur when the LHS portion of an expression is missing. > +Though we would consider this invalid code, this should not generate an ICE. > +This was noticed during debug of PR81317. */ We usually indent comments, so three spaces at the start of each of the last three lines. Not that testcases really have to follow the GNU coding style. This comment is nicely informative in either case, thanks :-) The patch is fine with the typographical stuff fixed (and Bill's comment). Segher