Bug 65181 - Support for alloca in nvptx
Summary: Support for alloca in nvptx
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 80686 80687
  Show dependency treegraph
 
Reported: 2015-02-23 17:48 UTC by Thomas Schwinge
Modified: 2019-03-14 10:34 UTC (History)
2 users (show)

See Also:
Host:
Target: nvptx
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-03-14 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schwinge 2015-02-23 17:48:01 UTC
There is no alloca in PTX, but can it perhaps be implemented using PTX local memory?
Comment 1 Thomas Schwinge 2015-02-23 17:52:13 UTC
Author: tschwinge
Date: Mon Feb 23 17:51:41 2015
New Revision: 220915

URL: https://gcc.gnu.org/viewcvs?rev=220915&root=gcc&view=rev
Log:
[PR target/65181] nvptx libgcc: Prevent building "advanced" stuff (for example, gcov support)

When building GCC against a proper newlib sysroot, the libgcc build will
include more than what's built in the -Dinhibit_libc configuration used when
building newlib as part of the GCC build process.  See the inhibit_libc logic
in gcc/configure.ac.

To avoid...

    ptxas _gcov_indirect_call_topn_profiler.o, line 101; error   : Type or alignment of argument does not match formal parameter 'ptr'
    ptxas _gcov_indirect_call_topn_profiler.o, line 101; error   : Call has wrong number of parameters
    ptxas _gcov_indirect_call_topn_profiler.o, line 101; error   : Type or alignment of argument does not match formal parameter 'size'
    ptxas fatal   : Ptx assembly aborted due to errors
    nvptx-as: ptxas returned 255 exit status
    make[2]: *** [_gcov_indirect_call_topn_profiler.o] Error 1

..., "dumb down" the libgcc build:

	libgcc/
	PR target/65181
	* config/nvptx/t-nvptx (INHIBIT_LIBC_CFLAGS): Define to
	-Dinhibit_libc.

Modified:
    trunk/libgcc/ChangeLog
    trunk/libgcc/config/nvptx/t-nvptx
Comment 2 Martin Liška 2018-11-19 13:23:21 UTC
Can the bug be marked as resolved?
Comment 3 Thomas Schwinge 2019-03-14 10:34:06 UTC
(In reply to Martin Liška from comment #2)
> Can the bug be marked as resolved?

No.

(In reply to Thomas Schwinge from comment #0)
> There is no alloca in PTX, but can it perhaps be implemented using PTX local
> memory?

..., and for "gang-private"/"gang-local" memory (PTX '.shared'), this supposedly will need cooperation with the GPU kernel launching ('cuLaunchKernel'), specifying "the amount of dynamic shared memory that will be available to each thread block"?