This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,PTX] Add support for CUDA 9
- From: Thomas Schwinge <thomas at codesourcery dot com>
- To: <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Cc: Tom de Vries <Tom_deVries at mentor dot com>, Cesar Philippidis <cesar at codesourcery dot com>
- Date: Tue, 27 Feb 2018 15:08:24 +0100
- Subject: Re: [PATCH,PTX] Add support for CUDA 9
- Authentication-results: sourceware.org; auth=none
- References: <002bf03f-baad-5809-6e9a-2fdffa0c1e2c@codesourcery.com> <b5538b37-d900-2fb1-b60e-bd1d76b247fe@mentor.com> <6fd03d69-e18f-fb3d-f7c3-f833c8ba5ff7@codesourcery.com> <eb73444a-3b12-8436-1569-9b36e1a70862@mentor.com>
Hi!
Given that several users have run into this, is this (trunk r256891) OK
to commit to open release branches, too?
On Fri, 19 Jan 2018 09:42:08 +0100, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 01/19/2018 01:59 AM, Cesar Philippidis wrote:
> > Here's the updated patch with the changes that you requested. There are
> > no new regressions in trunk. I tested it on my desktop running driver
> > 387.34 on a Pascal GPU.
> >
> > Is this OK for trunk?
>
> OK with 'PR target/83790' added to the changelog entry.
>
> Thanks,
> - Tom
>
> >
> > trunk-cuda9.diff
> >
> >
> > 2018-01-18 Cesar Philippidis <cesar@codesourcery.com>
> >
> > gcc/
> > * config/nvptx/nvptx.c (output_init_frag): Don't use generic address
> > spaces for function labels.
> >
> > gcc/testsuite/
> > * gcc.target/nvptx/indirect_call.c: New test.
> >
> > diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
> > index 86fc13f4fc0..4cb87c8ad07 100644
> > --- a/gcc/config/nvptx/nvptx.c
> > +++ b/gcc/config/nvptx/nvptx.c
> > @@ -1899,9 +1899,15 @@ output_init_frag (rtx sym)
> >
> > if (sym)
> > {
> > - fprintf (asm_out_file, "generic(");
> > + bool function = (SYMBOL_REF_DECL (sym)
> > + && (TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL));
> > + if (!function)
> > + fprintf (asm_out_file, "generic(");
> > output_address (VOIDmode, sym);
> > - fprintf (asm_out_file, val ? ") + " : ")");
> > + if (!function)
> > + fprintf (asm_out_file, ")");
> > + if (val)
> > + fprintf (asm_out_file, " + ");
> > }
> >
> > if (!sym || val)
> > diff --git a/gcc/testsuite/gcc.target/nvptx/indirect_call.c b/gcc/testsuite/gcc.target/nvptx/indirect_call.c
> > new file mode 100644
> > index 00000000000..39992a7137b
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.target/nvptx/indirect_call.c
> > @@ -0,0 +1,19 @@
> > +/* { dg-options "-O2 -msoft-stack" } */
> > +/* { dg-do run } */
> > +
> > +int
> > +f1 (int a)
> > +{
> > + return a + 1;
> > +}
> > +
> > +int (*f2)(int) = f1;
> > +
> > +int
> > +main ()
> > +{
> > + if (f2 (100) != 101)
> > + __builtin_abort();
> > +
> > + return 0;
> > +}
Grüße
Thomas