This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Graphite-Branch] Fix for dealII?
- From: Richard Guenther <rguenther at suse dot de>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: Tobias Grosser <grosser at fim dot uni-passau dot de>, gcc-graphite <gcc-graphite at googlegroups dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 3 Mar 2010 10:57:17 +0100 (CET)
- Subject: Re: [Graphite-Branch] Fix for dealII?
- References: <1267486860-9791-1-git-send-email-grosser@fim.uni-passau.de> <10734_1267522625_4B8CDC41_10734_599_1_cb9d34b21003020136u6caec28bp72c4c8fab6732fac@mail.gmail.com> <4B8CF475.1030208@fim.uni-passau.de> <cb9d34b21003021247k7bc63effyc1dc43417627fb42@mail.gmail.com>
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.