On 6/1/21 11:04 PM, Kewen Lin via Gcc-patches wrote:
As Segher suggested, this patch is to emit the error message
if the split condition of define_insn_and_split is empty while
the insn condition isn't.

gcc/ChangeLog:

        * gensupport.c (process_rtx): Emit error message for empty
        split condition in define_insn_and_split while the insn
        condition isn't.
---
  gcc/gensupport.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 0f19bd70664..52cee120215 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -620,6 +620,9 @@ process_rtx (rtx desc, file_location loc)
          }
        else if (GET_CODE (desc) == DEFINE_INSN_AND_REWRITE)
          error_at (loc, "the rewrite condition must start with `&&'");
+       else if (split_cond[0] == '\0' && strlen (XSTR (desc, 2)) != 0)
+         error_at (loc, "the split condition mustn't be empty if the "
+                        "insn condition isn't empty");

The "mustn't" (and other similar contractions) should trigger
-Wdiag-format that GCC should be free of, or was not too long ago.
Can you please spell them out (the suggested alternative spelling
should be mentined in the warning)?

Also, "insn" is not a word, and even though it's common abbreviation
in GCC speak it's not necessarily something all users are familiar
with, and doesn't lend itself to translation.  Please spell out
the word instead.

Thanks
Martin

        XSTR (split, 1) = split_cond;
        if (GET_CODE (desc) == DEFINE_INSN_AND_REWRITE)
          XVEC (split, 2) = gen_rewrite_sequence (XVEC (desc, 1));


Reply via email to