This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[committed] Fix instruction architecture promotion on HP PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sources dot redhat dot com
- Date: Sat, 16 Jul 2005 20:37:30 -0400 (EDT)
- Subject: [committed] Fix instruction architecture promotion on HP PA
The following change fixes the promotion of instruction matches on HP
PA. It's now possible to build GCC using --with-arch=1.0 and end up
with a PA 1.0 version of cc1.
Tested on hppa-unknown-linux with no regressions. Committed to trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2005-07-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* config/tc-hppa.c (pa_ip): Search entire mnemonic before considering
promoted match.
Index: config/tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.121
diff -u -3 -p -r1.121 tc-hppa.c
--- config/tc-hppa.c 10 Jun 2005 05:46:48 -0000 1.121
+++ config/tc-hppa.c 17 Jul 2005 00:19:47 -0000
@@ -1577,10 +1577,12 @@ pa_ip (str)
char *s, c, *argstart, *name, *save_s;
const char *args;
int match = FALSE;
+ int need_promotion = FALSE;
int comma = 0;
int cmpltr, nullif, flag, cond, num;
unsigned long opcode;
struct pa_opcode *insn;
+ struct pa_opcode *promoted_insn = NULL;
#ifdef OBJ_SOM
/* We must have a valid space and subspace. */
@@ -3956,8 +3958,17 @@ pa_ip (str)
if (match == TRUE
&& bfd_get_mach (stdoutput) < insn->arch)
{
- if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, insn->arch))
- as_warn (_("could not update architecture and machine"));
+ if (need_promotion)
+ {
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, insn->arch))
+ as_warn (_("could not update architecture and machine"));
+ }
+ else
+ {
+ match = FALSE;
+ if (!promoted_insn)
+ promoted_insn = insn;
+ }
}
failed:
@@ -3973,6 +3984,13 @@ pa_ip (str)
}
else
{
+ if (promoted_insn)
+ {
+ insn = promoted_insn;
+ need_promotion = TRUE;
+ s = argstart;
+ continue;
+ }
as_bad (_("Invalid operands %s"), error_message);
return;
}