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]

Re: Use of as_fatal


On Mon, 18 Apr 2005 15:12:36 +0200
"Jan Beulich" <JBeulich@novell.com> wrote:

> As the new 'macros dot' test has uncovered and (assuming the
> corresponding patch will get approved) 'macros purge' will too for
> some of the targets mentioned below, there is an issue with using
> as_fatal in places where the failure doesn't really appear to be
> fatal. Namely, when just an opcode isn't recognized (as would happen
> when one tries to reference a macro that isn't defined (yet/anymore),
> this condition is supposed to be hit. I am therefore wondering if the
> maintainers of the following targets could shed some light on the
> reasons why as_fatal is being used in this case by these targets; the
> outcome will help determine whether the target specific code should be
> changed or instead the target be excluded from running these tests.

[ please line-wrap your emails in the future, much appreciated... ]

I fixed the as_fatal() which was tripping up the macro dot testcases.
Patch below.

While macro dot appears to be fixes on Sparc, the new macro purge testcase
seems to hang infinitely.  As far as I can tell it is trying to expand macros
over and over for some reason.  I thought initially this was caused
by tc-sparc.c:sparc_ip()'s modification of the string it is given,
yet tests of making sparc_ip() not do this didn't fix the problem.

2005-04-18  David S. Miller  <davem@davemloft.net>

	* config/tc-sparc.c (md_assemble): If sparc_ip gives us a
	NULL insn, exit early.  Remove now spurious NULL checks.
	(sparc_ip): Use as_bad for unknown opcode errors, set *pinsn
	to NULL and exit.

--- config/tc-sparc.c	18 Feb 2005 00:49:03 -0000	1.54
+++ config/tc-sparc.c	18 Apr 2005 20:20:58 -0000
@@ -1304,11 +1304,12 @@ md_assemble (str)
 
   know (str);
   special_case = sparc_ip (str, &insn);
+  if (insn == NULL)
+    return;
 
   /* We warn about attempts to put a floating point branch in a delay slot,
      unless the delay slot has been annulled.  */
-  if (insn != NULL
-      && last_insn != NULL
+  if (last_insn != NULL
       && (insn->flags & F_FBR) != 0
       && (last_insn->flags & F_DELAYED) != 0
       /* ??? This test isn't completely accurate.  We assume anything with
@@ -1321,7 +1322,6 @@ md_assemble (str)
      point instruction and a floating point branch.  We insert one
      automatically, with a warning.  */
   if (max_architecture < SPARC_OPCODE_ARCH_V9
-      && insn != NULL
       && last_insn != NULL
       && (insn->flags & F_FBR) != 0
       && (last_insn->flags & F_FLOAT) != 0)
@@ -1417,7 +1417,9 @@ sparc_ip (str, pinsn)
       break;
 
     default:
-      as_fatal (_("Unknown opcode: `%s'"), str);
+      as_bad (_("Unknown opcode: `%s'"), str);
+      *pinsn = NULL;
+      return special_case;
     }
   insn = (struct sparc_opcode *) hash_find (op_hash, str);
   *pinsn = insn;


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