This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Graphite-Branch] Fix for dealII?


On Tue, 2 Mar 2010, Sebastian Pop wrote:

> Hi,
> 
> On Tue, Mar 2, 2010 at 05:20, Tobias Grosser <grosser@fim.uni-passau.de> wrote:
> > On 03/02/2010 10:36 AM, Sebastian Pop wrote:
> >>> diff --git a/gcc/graphite-clast-to-gimple.c
> >>> b/gcc/graphite-clast-to-gimple.c
> >>> index bf6949d..88aba53 100644
> >>> --- a/gcc/graphite-clast-to-gimple.c
> >>> +++ b/gcc/graphite-clast-to-gimple.c
> >>> @@ -282,14 +282,15 @@ clast_to_gcc_expression (tree type, struct
> >>> clast_expr *e,
> >>> ? ? ? ? ? ? ?{
> >>> ? ? ? ? ? ? ? ?tree name = clast_name_to_gcc (t->var, region, newivs,
> >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? newivs_index,
> >>> params_index);
> >>> - ? ? ? ? ? ? ? return fold_convert (type, name);
> >>> + ? ? ? ? ? ? ? name = fold_build1 (VIEW_CONVERT_EXPR, type, name);
> >>
> >> Why do you need this change?
> >
> > The problem is if the loop iv is long long integer and it is initialized
> > from something like *char compiled with -m32. In this case fold_convert does
> > not add any conversion caracter, but a NOP, but fails in verify_stmts with
> > "invalid types in nop conversion", I did it while traveling so did not have
> > delta to generate a reduced test case.
> >
> > I will install it and add a test case to show why it is necessary. Maybe
> > there is a unhandled case in fold_convert, but it will be easier to
> > understand with a test case.
> >
> 
> Richi, can we use the VIEW_CONVERT_EXPR instead of the call to
> fold_convert in this case?

No.  You need to convert a pointer to an integer type of same size
(you can use sizetype) and then extend it to long long.  Thus,

  if (POINTER_TYPE_P (TREE_TYPE (name)) != POINTER_TYPE_P (type))
    name = fold_convert (sizetype, name);
  name = fold_convert (type, name);

Richard.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]