[parisc-linux] [patch] Remove magic constant from gas/tc-hppa.c

John David Anglin dave@hiauly1.hia.nrc.ca
Sun Oct 22 01:22:00 GMT 2006


       if (bfd_get_mach (stdoutput) < pa11)

You missed the above pa11 and a couple of pa20 uses.  It would
be nice if the duplication present in the definition of the enum
pa_arch and the bfd_mach_* defines could be eliminated.  However,
I think using the bfd_mach values in the opcode table would be
ugly.

+  unsigned long mach = bfd_mach_hppa10;
+
+#if TARGET_ARCH_SIZE == 64
+  mach = bfd_mach_hppa20w;
+#endif 

Although gcc likely can eliminate the first assignment, I would
write this as follows:

#if TARGET_ARCH_SIZE == 64
  unsigned long mach = bfd_mach_hppa20w;
#else
  unsigned long mach = bfd_mach_hppa10;
#endif 

Ultimately, it would be nice to turn all the TARGET_ARCH_SIZE
tests into runtime checks.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)



More information about the Binutils mailing list