Improve warning messages for la/dla
authorMatthew Fortune <matthew.fortune@imgtec.com>
Thu, 23 Apr 2015 19:09:13 +0000 (20:09 +0100)
committerMatthew Fortune <matthew.fortune@imgtec.com>
Thu, 23 Apr 2015 21:23:17 +0000 (22:23 +0100)
gas/

* config/tc-mips.c (macro): State the recommended way of creating
32-bit or 64-bit addresses.

gas/testsuite/

* gas/mips/dla-warn.l: New file.
* gas/mips/dla-warn.s: New file.
* gas/mips/la-warn.l: New file.
* gas/mips/la-warn.s: New file.
* gas/mips/mips.exp: Run new tests.

gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/dla-warn.l [new file with mode: 0644]
gas/testsuite/gas/mips/dla-warn.s [new file with mode: 0644]
gas/testsuite/gas/mips/la-warn.l [new file with mode: 0644]
gas/testsuite/gas/mips/la-warn.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index d2698bc90b1edd4424cb9e9d7c9d5364870ddd7a..4bdbe5d62bb11008d0c20aa2bcf184b6d2caf766 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-23  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * config/tc-mips.c (macro): State the recommended way of creating
+       32-bit or 64-bit addresses.
+
 2015-04-23  Jan Beulich  <jbeulich@suse.com>
 
        * config/tc-i386.c (match_mem_size): Also allow no size
index e61bb4daab15e5a35d207f98a1a3f6bb80b4c26e..40e38f88e1dad6ab34e0aa7a4b315a0ec5058897 100644 (file)
@@ -10331,10 +10331,12 @@ macro (struct mips_cl_insn *ip, char *str)
 
       breg = op[2];
       if (dbl && GPR_SIZE == 32)
-       as_warn (_("dla used to load 32-bit register"));
+       as_warn (_("dla used to load 32-bit register; recommend using la "
+                  "instead"));
 
       if (!dbl && HAVE_64BIT_OBJECTS)
-       as_warn (_("la used to load 64-bit address"));
+       as_warn (_("la used to load 64-bit address; recommend using dla "
+                  "instead"));
 
       if (small_offset_p (0, align, 16))
        {
index 493edba5d4353ed5e324d4a92cd806319877b57d..c28a6a2ca652c5e27b2bbecb85c92be9ad910ccd 100644 (file)
@@ -1,3 +1,11 @@
+2015-04-23  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * gas/mips/dla-warn.l: New file.
+       * gas/mips/dla-warn.s: New file.
+       * gas/mips/la-warn.l: New file.
+       * gas/mips/la-warn.s: New file.
+       * gas/mips/mips.exp: Run new tests.
+
 2015-04-23  Matthew Fortune  <matthew.fortune@imgtec.com>
 
        * gas/mips/mips.exp: Require o32 for r6-branch-constraints.
diff --git a/gas/testsuite/gas/mips/dla-warn.l b/gas/testsuite/gas/mips/dla-warn.l
new file mode 100644 (file)
index 0000000..4a25ea3
--- /dev/null
@@ -0,0 +1,2 @@
+.*: Assembler messages:
+.*:1: Warning: dla used to load 32-bit register; recommend using la instead
diff --git a/gas/testsuite/gas/mips/dla-warn.s b/gas/testsuite/gas/mips/dla-warn.s
new file mode 100644 (file)
index 0000000..a2c60c1
--- /dev/null
@@ -0,0 +1 @@
+       dla $2, foo
diff --git a/gas/testsuite/gas/mips/la-warn.l b/gas/testsuite/gas/mips/la-warn.l
new file mode 100644 (file)
index 0000000..05eaf8a
--- /dev/null
@@ -0,0 +1,2 @@
+.*: Assembler messages:
+.*:1: Warning: la used to load 64-bit address; recommend using dla instead
diff --git a/gas/testsuite/gas/mips/la-warn.s b/gas/testsuite/gas/mips/la-warn.s
new file mode 100644 (file)
index 0000000..894dba5
--- /dev/null
@@ -0,0 +1 @@
+       la $2, foo
index cdb66fc147855c467dcf27cf2387034355b8fe03..c3c33643c36f7b7677efe9ff5592ca02719347e9 100644 (file)
@@ -1223,8 +1223,12 @@ if { [istarget mips*-*-vxworks*] } {
     run_list_test "ase-errors-4" "-mabi=o64 -march=mips3" "ASE errors (4)"
 
     run_dump_test_arches "la-reloc"    [mips_arch_list_matching mips1]
+    run_list_test "dla-warn" "-mabi=32 -march=mips3" \
+                            "DLA with 32-bit addresses"
     if { $has_newabi } {
        run_dump_test_arches "dla-reloc" [mips_arch_list_matching mips3]
+       run_list_test "la-warn" "-mabi=64 -march=mips3" \
+                               "LA with 64-bit addresses"
     }
 
     # Start with MIPS II to avoid load delay nops.