diff options
author | Tom de Vries <tdevries@suse.de> | 2022-03-20 12:10:45 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-03-22 14:40:04 +0100 |
commit | 24ee43194a542768b987be5d8021ae4ba7bad7b5 (patch) | |
tree | cf83687b1d2def562c811fba90ea354a4b18eeb6 /gcc/config/nvptx | |
parent | b57358cc71356c817500042f7d517ac3309195b1 (diff) | |
download | gcc-24ee43194a542768b987be5d8021ae4ba7bad7b5.zip gcc-24ee43194a542768b987be5d8021ae4ba7bad7b5.tar.gz gcc-24ee43194a542768b987be5d8021ae4ba7bad7b5.tar.bz2 |
[nvptx] Use '%' as register prefix
The percentage sign as first character of a ptx identifier can be used to
avoid name conflicts, e.g., between user-defined variable names and
compiler-generated names.
The insn nvptx_uniform_warp_check contains register names without '%' prefix,
which potentially could lead to name conflicts with user-defined variable
names.
Fix this by adding a '%' prefix, more specifically a '%r_' prefix to avoid a
name conflict with ptx special registers.
Tested on x86_64 with nvptx accelerator.
gcc/ChangeLog:
2022-03-20 Tom de Vries <tdevries@suse.de>
PR target/104925
* config/nvptx/nvptx.md (define_insn "nvptx_uniform_warp_check"):
Use % as register prefix.
Diffstat (limited to 'gcc/config/nvptx')
-rw-r--r-- | gcc/config/nvptx/nvptx.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index 5550ce2..8ed6850 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -2280,13 +2280,14 @@ { const char *insns[] = { "{", - "\\t" ".reg.b32" "\\t" "act;", - "%.\\t" "vote.ballot.b32" "\\t" "act,1;", - "\\t" ".reg.pred" "\\t" "do_abort;", - "\\t" "mov.pred" "\\t" "do_abort,0;", - "%.\\t" "setp.ne.b32" "\\t" "do_abort,act,0xffffffff;", - "@ do_abort\\t" "trap;", - "@ do_abort\\t" "exit;", + "\\t" ".reg.b32" "\\t" "%%r_act;", + "%.\\t" "vote.ballot.b32" "\\t" "%%r_act,1;", + "\\t" ".reg.pred" "\\t" "%%r_do_abort;", + "\\t" "mov.pred" "\\t" "%%r_do_abort,0;", + "%.\\t" "setp.ne.b32" "\\t" "%%r_do_abort,%%r_act," + "0xffffffff;", + "@ %%r_do_abort\\t" "trap;", + "@ %%r_do_abort\\t" "exit;", "}", NULL }; |