[binutils-gdb] gas/arc: Use #define from include/opcode/arc.h

Andrew Burgess aburgess@sourceware.org
Mon Apr 4 08:16:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=26cdfd92055ece05e1abb5248ddb78f3386f857b

commit 26cdfd92055ece05e1abb5248ddb78f3386f857b
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Fri Apr 1 18:35:29 2016 +0100

    gas/arc: Use #define from include/opcode/arc.h
    
    In tc-arc.h we redefine constants that are also defined in the
    include/opcode/arc.h header file.  The problem is that changing one
    without changing the other resulting in strange crashes.
    
    We could comment both locations to stress the importance of remembering
    to update the other location too, or we could just include the
    opcode/arc.h header file into the assembler.
    
    Given that other targets include their opcode/ARCH.h header file, and
    only having a single definition, where possible, is usually the safest
    solution, that's what I switch too with this commit.
    
    gas/ChangeLog:
    
    	* config/tc-arc.h: Include 'opcode/arc.h'.
    	(MAX_INSN_ARGS): Delete.
    	(MAX_INSN_FLGS): Delete.

Diff:
---
 gas/ChangeLog       | 6 ++++++
 gas/config/tc-arc.h | 9 +--------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6159218..46ce10d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-04  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* config/tc-arc.h: Include 'opcode/arc.h'.
+	(MAX_INSN_ARGS): Delete.
+	(MAX_INSN_FLGS): Delete.
+
 2016-04-04  Alan Modra  <amodra@gmail.com>
 
 	PR 19498
diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index 93a7d77..7c193fe 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -20,6 +20,7 @@
    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
+#include "opcode/arc.h"
 
 /* By convention, you should define this macro in the `.h' file.  For
    example, `tc-m68k.h' defines `TC_M68K'.  You might have to use this
@@ -221,14 +222,6 @@ struct arc_flags
   unsigned char code;
 };
 
-#ifndef MAX_INSN_ARGS
-#define MAX_INSN_ARGS	     6
-#endif
-
-#ifndef MAX_INSN_FLGS
-#define MAX_INSN_FLGS	     3
-#endif
-
 extern const relax_typeS md_relax_table[];
 #define TC_GENERIC_RELAX_TABLE md_relax_table



More information about the Binutils-cvs mailing list