Le 08/06/2023 à 11:58, Tamar Christina via Gcc-patches a écrit :
Hi,

New version of the patch, I've omitted the explanation again 😊

Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.

Any feedback?

Hello,

this is not my area of expertise, but I saw the following:

+  /* [ns..ns + len) should be a string with the id of the rtx to match
+     i.e. if rtx is the relevant match_operand or match_scratch then
+     [ns..ns + len) should equal itoa (XINT (rtx, 0)), and if set_attr then
+     [ns..ns + len) should equal XSTR (rtx, 0).  */
+  conlist (const char *ns, unsigned int len, bool numeric)
+  {
+    /* Trim leading whitespaces.  */
+    while (ISSPACE (*ns))
+      {
+       ns++;
+       len--;
+      }
+
+    /* Trim trailing whitespace.  */
+    for (int i = len - 1; i >= 0; i++, len--)
+      if (!ISSPACE (*ns))
+       break;
+
This for loop makes little sense to me. Shouldn't the iteration step be i-- rather than i++ and the pointer dereference *(ns + i) rather than *ns?

Reply via email to