public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFD] MIPS/gas: Optimisation cannot be set to 0
@ 2007-11-09 13:52 Maciej W. Rozycki
  2007-11-09 15:56 ` Thiemo Seufer
  2007-11-09 16:10 ` Ian Lance Taylor
  0 siblings, 2 replies; 10+ messages in thread
From: Maciej W. Rozycki @ 2007-11-09 13:52 UTC (permalink / raw)
  To: binutils; +Cc: Maciej W. Rozycki

Hello,

 Browsing through gas code I have noticed this snippet:

/* Whether we are optimizing.  The default value of 2 means to remove
   unneeded NOPs and swap branch instructions when possible.  A value
   of 1 means to not swap branches.  A value of 0 means to always
   insert NOPs.  */
static int mips_optimize = 2;

and all the three values are checked against throughout.  However, it is 
not possible to set the variable to 0 -- the only piece of code doing 
initialisation is this:

    case 'O':
      if (arg && arg[0] == '0')
	mips_optimize = 1;
      else
	mips_optimize = 2;
      break;

in md_parse_option().  It looks like it has been like this since our CVS 
tree was born.  There is this ChangeLog entry which may be of relevance 
though:

Wed Feb 12 14:36:29 1997  Ian Lance Taylor  <ian@cygnus.com>

	* config/tc-mips.c (md_parse_option): When debugging, set
	mips_optimize to 1, not 0.

 Anyway, the outcome is we have dead code and unclear semantics.  The most 
obvious solution is mapping the argument of -O directly to the value of 
mips_optimize.  The drawback is changed semantics.  Another possibility is 
getting rid of what currently mips_optimize == 1 means entirely.  And 
there may be more reasonable options available.

 I have no strong preference, but I think gas should have a mode where its 
input is assembled intact.  And swapping branches may produce surprising 
interactions with debugging information.  I am therefore in favour to the 
first proposal above, but I would like to hear from the others.

  Maciej

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-11-14 17:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-09 13:52 [RFD] MIPS/gas: Optimisation cannot be set to 0 Maciej W. Rozycki
2007-11-09 15:56 ` Thiemo Seufer
2007-11-09 16:10 ` Ian Lance Taylor
2007-11-09 17:35   ` Maciej W. Rozycki
2007-11-09 17:56   ` Paul Koning
2007-11-09 18:31     ` Maciej W. Rozycki
2007-11-11 11:24       ` Richard Sandiford
2007-11-12 18:07         ` Maciej W. Rozycki
2007-11-12 19:39           ` Richard Sandiford
2007-11-14 17:57   ` Thiemo Seufer

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).