Bug 2623 - No line separator character is defined for msp430-gas
Summary: No line separator character is defined for msp430-gas
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P3 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-28 15:43 UTC by c.plouet
Modified: 2007-02-28 10:02 UTC (History)
2 users (show)

See Also:
Host:
Target: msp430
Build:
Last reconfirmed:


Attachments
Change line command character to '{' (288 bytes, patch)
2007-02-28 10:01 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description c.plouet 2006-04-28 15:43:30 UTC
This prevents from (ab)using the C preprocessor to generate assembly code (e.g.
to generate different versions of a time-critical routine by inserting a
variable amount of wait cycles/NOP instructions through a macro), because
multiline macros (using '\') are turned into single lines. And when msp430-gas
reads multiple instructions on a single line it translates the first one only
and silently ignores the other ones.

Could line 171 of file src/gas/config/tc-msp430.c (revision 1.23) be changed to
something else? Maybe something like:

const char line_separator_chars[] = ":";

instead of :

const char line_separator_chars[] = "";


I have no idea if ":" really is reasonable here; it looks like it's of no use in
MSP430 assembly code anyway, but I could be wrong.
Comment 1 Nick Clifton 2006-05-08 17:07:22 UTC
Hi Corentin,

  Sorry - the colon character (:) is used - by the macro code.  See the file
gas/testsuite/gas/macros/vararg.s for an example of this, and an example of a
test that would fail if we applied the patch.

  The good news however is that the | character appears to be free.  So I am
going to apply this patch instead.

Cheers
  Nick

gas/ChangeLog
2006-05-08  Nick Clifton  <nickc@redhat.com>

	PR gas/2623
	* config/tc-msp430.c (line_separator_character): Define as |.

Index: gas/config/tc-msp430.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-msp430.c,v
retrieving revision 1.23
diff -c -3 -p -r1.23 tc-msp430.c
*** gas/config/tc-msp430.c	23 Apr 2006 22:12:43 -0000	1.23
--- gas/config/tc-msp430.c	8 May 2006 17:06:56 -0000
*************** static struct hcodes_s msp430_hcodes[] =
*** 168,174 ****
  
  const char comment_chars[] = ";";
  const char line_comment_chars[] = "#";
! const char line_separator_chars[] = "";
  const char EXP_CHARS[] = "eE";
  const char FLT_CHARS[] = "dD";
  
--- 168,174 ----
  
  const char comment_chars[] = ";";
  const char line_comment_chars[] = "#";
! const char line_separator_chars[] = "|";
  const char EXP_CHARS[] = "eE";
  const char FLT_CHARS[] = "dD";
  

Comment 2 Robert Schiele 2007-02-25 19:26:53 UTC
Hmm, wasn't '|' known to be the bitwise OR operator?
Comment 3 Nick Clifton 2007-02-27 11:44:53 UTC
Hi Robert,

> Hmm, wasn't '|' known to be the bitwise OR operator?

Yes.  But:

  a) Other ports use | as the line separator character.

  b) The patch has been in for a while now, so changing the character 
     will probably break existing msp430 sources.

Is this a big problem for you ?

Cheers
  Nick
Comment 4 Robert Schiele 2007-02-27 13:13:31 UTC
Well, maybe almost nobody noticed this until now because there was no official
binutils release since then.

Actually I consider this to be a problem because for example the msp430-libc
msp430/common.h header defines some constants to setup the watchdog. These
constants are designed to be put together by the OR operator to form a complete
setup.

Actually this change does currently break the jtag code from the mspgcc project
and I suspect a lot of people will start crying if you release the next binutils
package with this change.
Comment 5 Nick Clifton 2007-02-27 14:30:48 UTC
Subject: Re:  No line separator character is defined for msp430-gas

Hi Robert,

> Well, maybe almost nobody noticed this until now because there was no official
> binutils release since then.
> 
> Actually I consider this to be a problem because for example the msp430-libc
> msp430/common.h header defines some constants to setup the watchdog. These
> constants are designed to be put together by the OR operator to form a complete
> setup.
> 
> Actually this change does currently break the jtag code from the mspgcc project
> and I suspect a lot of people will start crying if you release the next binutils
> package with this change.

Alright then, is there an alternative character that you think would be 
suitable ?  '{' perhaps ?

Cheers
   Nick


Comment 6 Robert Schiele 2007-02-27 15:02:17 UTC
I will do a test build of the whole toolchain now including the jtag module to
test '{' as the separator and report back then...
Comment 7 Robert Schiele 2007-02-28 04:11:28 UTC
Ok, everything of the toolchain including the jtag module built fine with '{' as
separator. Since I can't see another problematic use of '{' for assembler code I
think this is a reasonable choice.
Comment 8 Nick Clifton 2007-02-28 10:01:05 UTC
Created attachment 1588 [details]
Change line command character to '{'
Comment 9 Nick Clifton 2007-02-28 10:02:04 UTC
Hi Robert,

  Excellent. I have applied the uploaded patch along with this ChangeLog entry.

Cheers
  Nick

gas/ChangeLog
	PR gas/2623
	* config/tc-msp430.c (line_separator_char): Change to '{'.