From: Thomas Schwinge Date: Thu, 13 Feb 2025 21:58:21 +0000 (+0100) Subject: nvptx: Clarify 'nvptx_output_skip' case of no or incomplete initializer X-Git-Tag: basepoints/gcc-16~2013 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09b207bf26b9c79a43e1a346a4493d4b202b4ac5;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 060f45318f4..6f364619205 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