This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Do not do gimple-folding of expressions that are missing their LHS
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Will Schmidt <will_schmidt at vnet dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Wed, 12 Jul 2017 16:21:10 -0500
- Subject: Re: [PATCH, rs6000] Do not do gimple-folding of expressions that are missing their LHS
- Authentication-results: sourceware.org; auth=none
- References: <1499877907.24125.400.camel@brimstone.rchland.ibm.com>
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