* PATCH: PR gas/4572: division doesn't work on solaris/x86
@ 2009-08-04 22:57 H.J. Lu
2009-08-04 23:41 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2009-08-04 22:57 UTC (permalink / raw)
To: binutils
Hi,
This patch treats `\/' as /. OK to install?
Thanks.
H.J.
---
gas/
2009-08-04 H.J. Lu <hongjiu.lu@intel.com>
PR gas/4572
* app.c (do_scrub_chars): Handle `\/'.
gas/testsuite/
2009-08-04 H.J. Lu <hongjiu.lu@intel.com>
PR gas/4572
* gas/i386/divide.s: Test `\/'.
* gas/i386/divide.d: Updated.
Index: gas/app.c
===================================================================
--- gas/app.c (revision 6517)
+++ gas/app.c (working copy)
@@ -702,6 +702,15 @@ do_scrub_chars (int (*get) (char *, int)
/* flushchar: */
ch = GET ();
+ /* Handle \/. */
+ if (ch == '/' && to > tostart && *(to - 1) == '\\')
+ {
+ to--;
+#ifdef TE_SOLARIS
+ goto de_fault;
+#endif
+ }
+
#ifdef TC_IA64
if (ch == '(' && (state == 0 || state == 1))
{
Index: gas/testsuite/gas/i386/divide.d
===================================================================
--- gas/testsuite/gas/i386/divide.d (revision 6517)
+++ gas/testsuite/gas/i386/divide.d (working copy)
@@ -5,5 +5,5 @@
.*: +file format .*
Contents of section .*
- 0000 01000000 02000000 03000000 04000000 .*
- 0010 05000000 .*
+ 0000 01000000 02000000 03000000 05000000 .*
+ 0010 06000000 06000000 .*
Index: gas/testsuite/gas/i386/divide.s
===================================================================
--- gas/testsuite/gas/i386/divide.s (revision 6517)
+++ gas/testsuite/gas/i386/divide.s (working copy)
@@ -1,6 +1,7 @@
start:
- .long 1,2,3,a,b
+ .long 1,2,3,a,b,c
/ This comment should still be allowed with --divide,
/ but the divide must remain a divide in the next line
a=(.-start)/4-1 # comment
b=(.-start)/4
+c=(.-start)\/4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: PR gas/4572: division doesn't work on solaris/x86
2009-08-04 22:57 PATCH: PR gas/4572: division doesn't work on solaris/x86 H.J. Lu
@ 2009-08-04 23:41 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2009-08-04 23:41 UTC (permalink / raw)
To: H.J. Lu; +Cc: binutils
On Tue, Aug 04, 2009 at 03:57:02PM -0700, H.J. Lu wrote:
> + /* Handle \/. */
> + if (ch == '/' && to > tostart && *(to - 1) == '\\')
So, if the output buffer just happened to fill up on the backslash,
then you will treat slash as a comment start? Not nice.
Looks like ARM has a similar bug when trying to avoid a comment start.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-04 23:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-04 22:57 PATCH: PR gas/4572: division doesn't work on solaris/x86 H.J. Lu
2009-08-04 23:41 ` Alan Modra
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).