This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for GAS treating -m32r as -m32rx


Hi Guys,

  I am applying the following patch to fix a small bug with GAS for
  the m32r.  Without this patch applied it will treat a command line
  switch of -m32r as if it were -m32rx, and enable the generation of
  M32RX instructions and optimisations.

  The fix is to add a specific -m32r option, which directly selects
  M32R compatability only.

Cheers
	Nick

2000-03-06  Nick Clifton  <nickc@cygnus.com>

	* config/tc-m32r.c (struct md_longopts): Add -m32r command line
	switch.
	(md_parse_option): Parse -m32r command line switch - disable m32rx
	compatability.

Index: gas/config/tc-m32r.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/tc-m32r.c,v
retrieving revision 1.75
diff -p -r1.75 tc-m32r.c
*** tc-m32r.c	2000/02/10 22:34:28	1.75
--- tc-m32r.c	2000/03/06 23:00:56
*************** const char * md_shortopts = M32R_SHORTOP
*** 157,185 ****
  
  struct option md_longopts[] =
  {
! #define OPTION_M32RX	(OPTION_MD_BASE)
    {"m32rx", no_argument, NULL, OPTION_M32RX},
- #define OPTION_WARN_PARALLEL	(OPTION_MD_BASE + 1)
    {"warn-explicit-parallel-conflicts", no_argument, NULL, OPTION_WARN_PARALLEL},
    {"Wp", no_argument, NULL, OPTION_WARN_PARALLEL},
- #define OPTION_NO_WARN_PARALLEL	(OPTION_MD_BASE + 2)
    {"no-warn-explicit-parallel-conflicts", no_argument, NULL, OPTION_NO_WARN_PARALLEL},
    {"Wnp", no_argument, NULL, OPTION_NO_WARN_PARALLEL},
- #define OPTION_SPECIAL	(OPTION_MD_BASE + 3)
    {"hidden", no_argument, NULL, OPTION_SPECIAL},
- 
    /* Sigh.  I guess all warnings must now have both variants.  */
- #define OPTION_WARN_UNMATCHED (OPTION_MD_BASE + 4)
    {"warn-unmatched-high", no_argument, NULL, OPTION_WARN_UNMATCHED},
    {"Wuh", no_argument, NULL, OPTION_WARN_UNMATCHED},
- #define OPTION_NO_WARN_UNMATCHED (OPTION_MD_BASE + 5)
    {"no-warn-unmatched-high", no_argument, NULL, OPTION_NO_WARN_UNMATCHED},
    {"Wnuh", no_argument, NULL, OPTION_NO_WARN_UNMATCHED},
  
  #if 0 /* not supported yet */
! #define OPTION_RELAX  (OPTION_MD_BASE + 6)
    {"relax", no_argument, NULL, OPTION_RELAX},
- #define OPTION_CPU_DESC (OPTION_MD_BASE + 7)
    {"cpu-desc", required_argument, NULL, OPTION_CPU_DESC},
  #endif
    {NULL, no_argument, NULL, 0}
--- 157,186 ----
  
  struct option md_longopts[] =
  {
! #define OPTION_M32R		(OPTION_MD_BASE)
! #define OPTION_M32RX		(OPTION_M32R + 1)
! #define OPTION_WARN_PARALLEL	(OPTION_M32RX + 1)
! #define OPTION_NO_WARN_PARALLEL	(OPTION_WARN_PARALLEL + 1)
! #define OPTION_SPECIAL		(OPTION_NO_WARN_PARALLEL + 1)
! #define OPTION_WARN_UNMATCHED 	(OPTION_SPECIAL + 1)
! #define OPTION_NO_WARN_UNMATCHED (OPTION_WARN_UNMATCHED + 1)
!   {"m32r",  no_argument, NULL, OPTION_M32R},
    {"m32rx", no_argument, NULL, OPTION_M32RX},
    {"warn-explicit-parallel-conflicts", no_argument, NULL, OPTION_WARN_PARALLEL},
    {"Wp", no_argument, NULL, OPTION_WARN_PARALLEL},
    {"no-warn-explicit-parallel-conflicts", no_argument, NULL, OPTION_NO_WARN_PARALLEL},
    {"Wnp", no_argument, NULL, OPTION_NO_WARN_PARALLEL},
    {"hidden", no_argument, NULL, OPTION_SPECIAL},
    /* Sigh.  I guess all warnings must now have both variants.  */
    {"warn-unmatched-high", no_argument, NULL, OPTION_WARN_UNMATCHED},
    {"Wuh", no_argument, NULL, OPTION_WARN_UNMATCHED},
    {"no-warn-unmatched-high", no_argument, NULL, OPTION_NO_WARN_UNMATCHED},
    {"Wnuh", no_argument, NULL, OPTION_NO_WARN_UNMATCHED},
  
  #if 0 /* not supported yet */
! #define OPTION_RELAX		(OPTION_NO_WARN_UNMATCHED + 1)
! #define OPTION_CPU_DESC		(OPTION_RELAX + 1)
    {"relax", no_argument, NULL, OPTION_RELAX},
    {"cpu-desc", required_argument, NULL, OPTION_CPU_DESC},
  #endif
    {NULL, no_argument, NULL, 0}
*************** md_parse_option (c, arg)
*** 197,202 ****
--- 198,207 ----
        optimize = 1;
        break;
  
+     case OPTION_M32R:
+       allow_m32rx (0);
+       break;
+       
      case OPTION_M32RX:
        allow_m32rx (1);
        break;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]