On Thu, Dec 13, 2018 at 03:44:25PM +0000, Julian Brown wrote:
> +static tree
> +convert_to_firstprivate_int (tree var, gimple_seq *gs)
> +{
> +  tree type = TREE_TYPE (var), new_type = NULL_TREE;
> +  tree tmp = NULL_TREE;
> +
> +  if (omp_is_reference (var))
> +    type = TREE_TYPE (type);
> +
> +  if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
> +    {
> +      if (omp_is_reference (var))
> +     {
> +       tmp = create_tmp_var (type);
> +       gimplify_assign (tmp, build_simple_mem_ref (var), gs);
> +       var = tmp;
> +     }
> +
> +      return fold_convert (pointer_sized_int_node, var);
> +    }
> +
> +  gcc_assert (tree_to_uhwi (TYPE_SIZE (type)) <= POINTER_SIZE);
> +
> +  new_type = lang_hooks.types.type_for_size (tree_to_uhwi (TYPE_SIZE (type)),
> +                                          true);
> +
> +  if (omp_is_reference (var))
> +    {
> +      tmp = create_tmp_var (type);
> +      gimplify_assign (tmp, build_simple_mem_ref (var), gs);
> +      var = tmp;
> +    }

Why are you duplicating this if?  Can't you just do it before the
  if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
test once, even better in the same if as you do type = TREE_TYPE (type); ?

Otherwise ok from me, but please check with Thomas if he is ok with it too.

        Jakub

Reply via email to