aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2025-02-13 22:58:21 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2025-02-14 22:33:24 +0100
commit09b207bf26b9c79a43e1a346a4493d4b202b4ac5 (patch)
tree98c16ea4b61c5e426cf9f203914eec68994b73cc /gcc
parent80b9c9c844458779556995a5be7c08a8894d0f96 (diff)
downloadgcc-09b207bf26b9c79a43e1a346a4493d4b202b4ac5.zip
gcc-09b207bf26b9c79a43e1a346a4493d4b202b4ac5.tar.gz
gcc-09b207bf26b9c79a43e1a346a4493d4b202b4ac5.tar.bz2
nvptx: Clarify 'nvptx_output_skip' case of no or incomplete initializer
I was getting confused about 'nvptx_output_skip' in certain cases not doing anything at all; write down and 'assert' what I found. gcc/ * config/nvptx/nvptx.cc (nvptx_output_skip): Clarify case of no or incomplete initializer.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/nvptx/nvptx.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 060f453..6f36461 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -2391,6 +2391,12 @@ nvptx_output_skip (FILE *, unsigned HOST_WIDE_INT size)
if (size)
nvptx_assemble_value (0, size);
}
+ else
+ /* Otherwise, we don't have to do anything: this skip terminates the
+ initializer; we skip either the full ('!init_frag.started' case) or the
+ remainder ('init_frag.started' case) of the initializer (that is, either
+ no or incomplete initializer). */
+ gcc_checking_assert (size == init_frag.remaining * init_frag.size);
}
/* Output a string STR with length SIZE. As in nvptx_output_skip we