public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Dmitry Selyutin <ghostmansd@gmail.com>
Cc: binutils@sourceware.org, Luke Leighton <luke.leighton@gmail.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: PowerPC: implement md_operand to parse register names
Date: Thu, 14 Jul 2022 15:33:20 +0930	[thread overview]
Message-ID: <Ys+xqNEMj+An8tNE@squeak.grove.modra.org> (raw)
In-Reply-To: <Ys7l+LZaCUdrN4JZ@squeak.grove.modra.org>

I meant to make this change before committing, to let compilers know
the code on the false branch of md_parse_name is dead.

	* config/tc-ppc.c (ppc_parse_name): Return void.
	* config/tc-ppc.h (md_parse_name): Always true.
	(ppc_parse_name): Update prototype.

diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 05d8ee19be7..452fab1cbfc 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -862,7 +862,7 @@ static const struct pd_reg cr_cond[] =
    to use for condition codes, and recognises other registers when
    -mregnames.  */
 
-int
+void
 ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode)
 {
   const struct pd_reg *reg = NULL;
@@ -877,7 +877,7 @@ ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode)
       exp->X_op = O_register;
       exp->X_add_number = reg->value;
       exp->X_md = reg->flags;
-      return true;
+      return;
     }
 
   /* The following replaces code in expr.c operand() after the
@@ -909,8 +909,6 @@ ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode)
       exp->X_add_symbol = sym;
       exp->X_add_number = 0;
     }
-
-  return true;
 }
 
 /* Propagate X_md and check register expressions.  This is to support
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index 480c952be45..de9522d4bf6 100644
--- a/gas/config/tc-ppc.h
+++ b/gas/config/tc-ppc.h
@@ -322,8 +322,9 @@ extern void ppc_frob_label (symbolS *);
 /* call md_pcrel_from_section, not md_pcrel_from */
 #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC)
 
-#define md_parse_name(name, exp, mode, c) ppc_parse_name (name, exp, mode)
-extern int ppc_parse_name (const char *, struct expressionS *, enum expr_mode);
+#define md_parse_name(name, exp, mode, c) \
+  (ppc_parse_name (name, exp, mode), true)
+extern void ppc_parse_name (const char *, struct expressionS *, enum expr_mode);
 
 #define md_optimize_expr(left, op, right) ppc_optimize_expr (left, op, right)
 extern int ppc_optimize_expr (expressionS *, operatorT, expressionS *);

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2022-07-14  6:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 13:50 [PATCH 0/1] ppc: support register names in macros Dmitry Selyutin
2022-07-12 13:50 ` [PATCH 1/1] " Dmitry Selyutin
2022-07-12 14:13   ` Dmitry Selyutin
2022-07-12 14:18   ` lkcl
2022-07-12 14:24     ` Dmitry Selyutin
2022-07-12 21:22 ` [PATCH v2 0/1] " Dmitry Selyutin
2022-07-12 21:22   ` [PATCH v2 1/1] " Dmitry Selyutin
2022-07-12 21:29     ` [PATCH v3 0/1] " Dmitry Selyutin
2022-07-12 21:29       ` [PATCH v3 1/1] " Dmitry Selyutin
2022-07-13 15:34         ` Alan Modra
2022-07-14  6:03           ` Alan Modra [this message]
2022-07-14  6:04           ` Dmitry Selyutin
2022-07-14  6:05             ` [PATCH] ppc: use reg_name_search for CFI register lookup Dmitry Selyutin
2022-07-14  7:25               ` Alan Modra
2022-07-14  8:21                 ` [PATCH v2] " Dmitry Selyutin
2022-07-14 23:01                   ` Alan Modra
2022-07-14  8:23                 ` [PATCH] " Dmitry Selyutin
2022-07-14  8:25                   ` Dmitry Selyutin
2022-07-14 23:02                     ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ys+xqNEMj+An8tNE@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ghostmansd@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=luke.leighton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).