This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][CilkPlus] Fix PR69363
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Wed, 17 Feb 2016 15:46:00 +0100
- Subject: Re: [PATCH][CilkPlus] Fix PR69363
- Authentication-results: sourceware.org; auth=none
- References: <20160217143258 dot GA31394 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 17, 2016 at 05:32:58PM +0300, Ilya Verbin wrote:
> This patch fixes <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69363>
> Bootstrap and make check passed. OK for... stage 1?
Ok for stage1, with a few nits.
> --- a/gcc/c/c-typeck.c
> +++ b/gcc/c/c-typeck.c
> @@ -12527,7 +12527,8 @@ c_find_omp_placeholder_r (tree *tp, int *, void *data)
> Remove any elements from the list that are invalid. */
>
> tree
> -c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd)
> +c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd,
> + bool is_cilk)
Instead of passing 3 bools, it might be better to pass either a tree_code
or some enum or bitmask that would tell the code what are the clauses
used on. But that can be done separately.
> + && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (t))
> + && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
> + {
> + error_at (OMP_CLAUSE_LOCATION (c),
> + "linear clause applied to non-integral, "
> + "non-floating, non-pointer variable with type %qT",
> + TREE_TYPE (t));
> + remove = true;
> + break;
> + }
> + }
> + else
> + {
> + if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
> + && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
> + {
> + error_at (OMP_CLAUSE_LOCATION (c),
> + "linear clause applied to non-integral non-pointer "
This line is too long. But you could have just done
else if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
&& TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
{
instead and then it would fit.
> --- a/gcc/cp/semantics.c
> +++ b/gcc/cp/semantics.c
> @@ -5736,7 +5736,8 @@ cp_finish_omp_clause_depend_sink (tree sink_clause)
> Remove any elements from the list that are invalid. */
>
> tree
> -finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd)
> +finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd,
> + bool is_cilk)
Similarly to the above note.
> + error ("linear clause applied to non-integral, "
> + "non-floating, non-pointer variable with %qT type",
Again too long line, that needs to be wrapped more.
> + TREE_TYPE (t));
> + remove = true;
> + break;
> + }
> + }
> + else
> + {
> + if (!INTEGRAL_TYPE_P (type)
> + && TREE_CODE (type) != POINTER_TYPE)
> + {
> + error ("linear clause applied to non-integral non-pointer "
> + "variable with %qT type", TREE_TYPE (t));
> + remove = true;
> + break;
And this can be done like I've hinted above.
Jakub