public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, MIPS] Improve warning messages for la/dla
@ 2015-04-23 19:49 Matthew Fortune
  2015-04-23 19:59 ` Richard Sandiford
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Fortune @ 2015-04-23 19:49 UTC (permalink / raw)
  To: binutils; +Cc: Richard Sandiford

I've had some feedback from long term MIPS users who have only previously
used MIPS32 and are now looking at MIPS64. The LA and DLA macros have
caused some confusion and I believe a bit of extra guidance in the warning
messages for these will help steer people to the correct fix.

OK to commit?

Thanks,
Matthew

gas/

	* config/tc-mips.c (macro): State the recommended way of creating
	32-bit or 64-bit addresses.
---
 gas/config/tc-mips.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index e61bb4d..40e38f8 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -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))
 	{
-- 
2.2.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, MIPS] Improve warning messages for la/dla
  2015-04-23 19:49 [PATCH, MIPS] Improve warning messages for la/dla Matthew Fortune
@ 2015-04-23 19:59 ` Richard Sandiford
  2015-04-23 20:17   ` Matthew Fortune
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Sandiford @ 2015-04-23 19:59 UTC (permalink / raw)
  To: Matthew Fortune; +Cc: binutils

Matthew Fortune <Matthew.Fortune@imgtec.com> writes:
> I've had some feedback from long term MIPS users who have only previously
> used MIPS32 and are now looking at MIPS64. The LA and DLA macros have
> caused some confusion and I believe a bit of extra guidance in the warning
> messages for these will help steer people to the correct fix.
>
> OK to commit?
>
> Thanks,
> Matthew
>
> gas/
>
> 	* config/tc-mips.c (macro): State the recommended way of creating
> 	32-bit or 64-bit addresses.

OK, thanks.  Guess this means we don't have any testcases for the
warning. :-)

Richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH, MIPS] Improve warning messages for la/dla
  2015-04-23 19:59 ` Richard Sandiford
@ 2015-04-23 20:17   ` Matthew Fortune
  2015-04-23 21:26     ` Matthew Fortune
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Fortune @ 2015-04-23 20:17 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: binutils

Richard Sandiford <rdsandiford@googlemail.com> writes:
> Matthew Fortune <Matthew.Fortune@imgtec.com> writes:
> > I've had some feedback from long term MIPS users who have only
> > previously used MIPS32 and are now looking at MIPS64. The LA and DLA
> > macros have caused some confusion and I believe a bit of extra
> > guidance in the warning messages for these will help steer people to
> the correct fix.
> >
> > OK to commit?
> >
> > Thanks,
> > Matthew
> >
> > gas/
> >
> > 	* config/tc-mips.c (macro): State the recommended way of creating
> > 	32-bit or 64-bit addresses.
> 
> OK, thanks.  Guess this means we don't have any testcases for the
> warning. :-)

Indeed, I was surprised too. I'll add one for each though given I
had the same thought as you.

Thanks,
Matthew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH, MIPS] Improve warning messages for la/dla
  2015-04-23 20:17   ` Matthew Fortune
@ 2015-04-23 21:26     ` Matthew Fortune
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Fortune @ 2015-04-23 21:26 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: binutils

> > > gas/
> > >
> > > 	* config/tc-mips.c (macro): State the recommended way of creating
> > > 	32-bit or 64-bit addresses.
> >
> > OK, thanks.  Guess this means we don't have any testcases for the
> > warning. :-)
> 
> Indeed, I was surprised too. I'll add one for each though given I had
> the same thought as you.

I committed this (inc test cases). 

Thanks,
Matthew

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                     | 5 +++++
 gas/config/tc-mips.c              | 6 ++++--
 gas/testsuite/ChangeLog           | 8 ++++++++
 gas/testsuite/gas/mips/dla-warn.l | 2 ++
 gas/testsuite/gas/mips/dla-warn.s | 1 +
 gas/testsuite/gas/mips/la-warn.l  | 2 ++
 gas/testsuite/gas/mips/la-warn.s  | 1 +
 gas/testsuite/gas/mips/mips.exp   | 4 ++++
 8 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 gas/testsuite/gas/mips/dla-warn.l
 create mode 100644 gas/testsuite/gas/mips/dla-warn.s
 create mode 100644 gas/testsuite/gas/mips/la-warn.l
 create mode 100644 gas/testsuite/gas/mips/la-warn.s

diff --git a/gas/ChangeLog b/gas/ChangeLog
index d2698bc..4bdbe5d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index e61bb4d..40e38f8 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -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))
 	{
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 493edba..c28a6a2 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,13 @@
 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.
 
 2015-04-23  Jan Beulich  <jbeulich@suse.com>
diff --git a/gas/testsuite/gas/mips/dla-warn.l b/gas/testsuite/gas/mips/dla-warn.l
new file mode 100644
index 0000000..4a25ea3
--- /dev/null
+++ b/gas/testsuite/gas/mips/dla-warn.l
@@ -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
index 0000000..a2c60c1
--- /dev/null
+++ b/gas/testsuite/gas/mips/dla-warn.s
@@ -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
index 0000000..05eaf8a
--- /dev/null
+++ b/gas/testsuite/gas/mips/la-warn.l
@@ -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
index 0000000..894dba5
--- /dev/null
+++ b/gas/testsuite/gas/mips/la-warn.s
@@ -0,0 +1 @@
+	la $2, foo
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index cdb66fc..c3c3364 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -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.
-- 
2.2.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-23 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23 19:49 [PATCH, MIPS] Improve warning messages for la/dla Matthew Fortune
2015-04-23 19:59 ` Richard Sandiford
2015-04-23 20:17   ` Matthew Fortune
2015-04-23 21:26     ` Matthew Fortune

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).