This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [nvptx, committed] Disable -gstatement-frontiers for nvptx
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jeff Law <law at redhat dot com>, Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Fri, 29 Dec 2017 12:42:34 +0100
- Subject: Re: [nvptx, committed] Disable -gstatement-frontiers for nvptx
- Authentication-results: sourceware.org; auth=none
- References: <orlgjec1b5.fsf_-_@lxoliva.fsfla.org> <20171110023448.28164-6-aoliva@redhat.com> <46e52372-6559-da67-6f90-074a80e6deae@mentor.com> <or8tdm9nq3.fsf@lxoliva.fsfla.org>
On 12/29/2017 05:12 AM, Alexandre Oliva wrote:
On Dec 27, 2017, Tom de Vries <Tom_deVries@mentor.com> wrote:
.loc file_index line_number column_position
so this causes ptxas errors when compiling something for nvptx with
-g, which breaks the nvptx build.
What do the errors look like?
The nvptx-none build breaks in libgcc:
...
configure:3706: error: in
`/home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/libgcc':
configure:3709: error: cannot compute suffix of object files: cannot compile
...
For this conftest.c:
...
#define PACKAGE_NAME "GNU C Runtime Library"
#define PACKAGE_TARNAME "libgcc"
#define PACKAGE_VERSION "1.0"
#define PACKAGE_STRING "GNU C Runtime Library 1.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
...
We get this error:
...
$ build-gcc/gcc/xgcc -Bbuild-gcc/gcc -c -g -O2 conftest.c
ptxas conftest.o, line 17; fatal : Parsing error near 'st': syntax error
ptxas fatal : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
...
By using -Wa,--no-verify, we can see the ptxas input:
...
$ cat -n conftest.o
...
15 mov.u32 %value,0;
16 .loc 1 15 1 is_stmt 0
17 st.param.u32 [%value_out],%value;
18 ret;
19 }
...
With -gno-statement-frontiers, we have this instead:
...
...
13 mov.u32 %value,0;
14 .loc 1 15 1
15 st.param.u32 [%value_out],%value;
16 ret;
17 }
...
and ptxas is able to parse the input.
I ask because the patches that actually change the generated debug info,
adding view to .loc lines when the assembler supports them, are yet to
be installed, in the patches that introduces LVUs. No significant
changes have been made to dwarf2out in the SFN patchset so far.
Furthermore, even with the LVU patch, .loc directives with view numbers
would only be used if the assembler is detected as supporting them at
compiler build time.
If you point me to the location of a configure test that is supposed to
file, I can try to find out why it passes.
Thanks,
- Tom