This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

[PATCH] Fix (p7) hint @pause (was Re: ionice kills vanilla 2.6.0-test9 was [Re: [PATCH] cfq + io priorities (fwd)])


On Sat, Nov 22, 2003 at 03:12:21PM +1030, Alan Modra wrote:
> On Fri, Nov 21, 2003 at 03:05:23PM -0800, Linus Torvalds wrote:
> > So it definitely _does_ work in some versions, and the bug appears to be 
> > new to binutils 2.14, with 2.13 doing the right thing.
> > 
> > You can trivially see if with a simple assembly file like
> > 
> > 	start:
> > 		.long 1,2,3,a
> > 	a=(.-start)/4
> 
> Broken with http://sources.redhat.com/ml/binutils/2003-04/msg00412.html
> and http://sources.redhat.com/ml/binutils/2003-04/msg00414.html.
> That '/' is being treated as a start of line comment char, thus trimming
> the rest of the line.
> 
> I think gas/app.c:do_scrub_chars is such an awful mess that it's
> impossible to get right.  Needs to be tossed out and rewritten.  The
> fundamental problem is that you can't track which component of an
> assember input line you're preprocessing without more information on the
> particular target syntax.  And most of the current complexity is just
> for deciding whether to remove whitespace!  That at least needs to go.
> 
> For now, I'm reverting HJ's patches and including your testcase in
> the gas testsuite.

I agree app.c is a mess.  But, as H.J. added in June special IA-64 states
14 and 15 to handle the other issues with IA-64 predicates, it seems
solvable very easily.
Either the following patch, or
if (ch == ')')
  state -= 14;
PUT (ch);
continue;
makes gas pass its testsuite on IA-64 again.
Letting the final ')' of predicate be parsed at state 0 or 1 doesn't seem
to be the right thing to do.

Ok to commit?

2003-11-23  Jakub Jelinek  <jakub@redhat.com>

	* app.c (do_scrub_chars): Add PUT (ch) and ch = GET ()
	when transitioning from states 14 or 15 to 0 or 1.

--- gas/app.c.jj	2003-11-22 12:16:10.000000000 +0100
+++ gas/app.c	2003-11-23 21:05:08.000000000 +0100
@@ -684,7 +684,11 @@ do_scrub_chars (int (*get) (char *, int)
       else if (state == 14 || state == 15)
 	{
 	  if (ch == ')')
-	    state -= 14;
+	    {
+	      state -= 14;
+	      PUT (ch);
+	      ch = GET ();
+	    }
 	  else
 	    {
 	      PUT (ch);


	Jakub


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