]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Clarify 'nvptx_output_skip' case of no or incomplete initializer
authorThomas Schwinge <tschwinge@baylibre.com>
Thu, 13 Feb 2025 21:58:21 +0000 (22:58 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Fri, 14 Feb 2025 21:33:24 +0000 (22:33 +0100)
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.

gcc/config/nvptx/nvptx.cc

index 060f45318f452ca40d46a0fba1ed8c7918ce0a1d..6f3646192056a8f766f7ef51e7a860927e1b1f27 100644 (file)
@@ -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