Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvptx-as reorders ".file" directives #20

Open
tschwinge opened this issue Sep 13, 2017 · 1 comment
Open

nvptx-as reorders ".file" directives #20

tschwinge opened this issue Sep 13, 2017 · 1 comment

Comments

@tschwinge
Copy link
Member

While filing https://gcc.gnu.org/PR82202, I noticed that nvptx-as reorders .file directives, for example compiling libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c with -fopenacc -O2 -foffload=nvptx-none='-save-temps -g' we got:

$ [...]/nvptx-none-as -o ccfEmvMv.s_ ccfEmvMv.s
$ diff -uw ccfEmvMv.s ccfEmvMv.s_
[...]
 // BEGIN FUNCTION DECL: main$_omp_fn$0
 .entry main$_omp_fn$0 (.param.u64 %in_ar0);
-
+.file 1 "source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c"
 // BEGIN FUNCTION DEF: main$_omp_fn$0
 .entry main$_omp_fn$0 (.param.u64 %in_ar0)
 {
@@ -46,7 +44,6 @@
        @%r54   bra     $L7;
                mov.u64 %r37, %ar0;
                mov.u32 %r36, %ctaid.x;
-       .file 1 "source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c"
        .loc 1 20 0
                shl.b32 %r39, %r36, 10;
                add.u32 %r40, %r39, %r36;

I don't think this is intentional?

@tschwinge
Copy link
Member Author

This behavior got implemented in commit bd12880 "Deal with .file and .loc directives".

I'll asume that the reason lies in PTX 3.1, 10.5 DEBUGGING DIRECTIVES, Table 162. Debugging Directives: .file stating that "The .file directive is allowed only in the outermost scope".

So, the reordering of .file directives seems to be intentional, after all. But, it needs to be documented properly.

tschwinge added a commit that referenced this issue Jan 7, 2021
This relates to commit bd12880 "Deal with
.file and .loc directives".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant