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.
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";
Hmm, wasn't '|' known to be the bitwise OR operator?
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
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.
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
I will do a test build of the whole toolchain now including the jtag module to test '{' as the separator and report back then...
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.
Created attachment 1588 [details] Change line command character to '{'
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 '{'.