* PATCH: COMMITTED: Fix typos in tc-cr16.c
@ 2010-11-05 11:01 Nick Clifton
2011-04-11 4:53 ` Alan Modra
0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2010-11-05 11:01 UTC (permalink / raw)
To: binutils
Hi Guys
I am applying the patch below (to mainline and the 2.21 branch) to fix
a couple of typos in tc-cr16.c that were exposed by a recent switch to
a gcc 4.5.1 compiler.
Cheers
Nick
gas/ChangeLog
2010-11-05 Nick Clifton <nickc@redhat.com>
* config/tc-cr16.c (getprocreg_image): Fix typo MAX_PREG ->
MAX_REG.
(getprocregp_image): Likewise.
Index: gas/config/tc-cr16.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-cr16.c,v
retrieving revision 1.10
diff -u -3 -p -r1.10 tc-cr16.c
--- gas/config/tc-cr16.c 11 Dec 2009 13:42:10 -0000 1.10
+++ gas/config/tc-cr16.c 5 Nov 2010 10:52:40 -0000
@@ -1669,7 +1669,7 @@ getprocreg_image (reg r)
char *reg_name;
/* Check whether the register is in registers table. */
- if (r < MAX_PREG)
+ if (r < MAX_REG)
rreg = &cr16_pregtab[r - MAX_REG];
/* Register not found. */
else
@@ -1708,7 +1708,7 @@ getprocregp_image (reg r)
int pregptab_disp = 0;
/* Check whether the register is in registers table. */
- if (r < MAX_PREG)
+ if (r < MAX_REG)
{
r = r - MAX_REG;
switch (r)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: COMMITTED: Fix typos in tc-cr16.c
2010-11-05 11:01 PATCH: COMMITTED: Fix typos in tc-cr16.c Nick Clifton
@ 2011-04-11 4:53 ` Alan Modra
2011-04-11 9:03 ` Nick Clifton
0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2011-04-11 4:53 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
On Fri, Nov 05, 2010 at 11:01:09AM +0000, Nick Clifton wrote:
> 2010-11-05 Nick Clifton <nickc@redhat.com>
>
> * config/tc-cr16.c (getprocreg_image): Fix typo MAX_PREG ->
> MAX_REG.
> (getprocregp_image): Likewise.
Nick,
I've been going over testsuite results, and this change causes a gas
testsuite failure. I believe we should have the following instead.
Applied mainline and 2.21.
* config/tc-cr16.c (getprocreg_image): Correct range check.
(getprocregp_image): Likewise.
Index: gas/config/tc-cr16.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-cr16.c,v
retrieving revision 1.11
diff -u -p -r1.11 tc-cr16.c
--- gas/config/tc-cr16.c 5 Nov 2010 11:08:27 -0000 1.11
+++ gas/config/tc-cr16.c 11 Apr 2011 04:46:20 -0000
@@ -1,5 +1,6 @@
/* tc-cr16.c -- Assembler code for the CR16 CPU core.
- Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright 2007, 2008, 2009, 2010, 2011
+ Free Software Foundation, Inc.
Contributed by M R Swami Reddy <MR.Swami.Reddy@nsc.com>
@@ -1669,7 +1670,7 @@ getprocreg_image (reg r)
char *reg_name;
/* Check whether the register is in registers table. */
- if (r < MAX_REG)
+ if (r >= MAX_REG && r < MAX_PREG)
rreg = &cr16_pregtab[r - MAX_REG];
/* Register not found. */
else
@@ -1708,7 +1709,7 @@ getprocregp_image (reg r)
int pregptab_disp = 0;
/* Check whether the register is in registers table. */
- if (r < MAX_REG)
+ if (r >= MAX_REG && r < MAX_PREG)
{
r = r - MAX_REG;
switch (r)
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: COMMITTED: Fix typos in tc-cr16.c
2011-04-11 4:53 ` Alan Modra
@ 2011-04-11 9:03 ` Nick Clifton
0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2011-04-11 9:03 UTC (permalink / raw)
To: binutils
Hi Alan,
>> * config/tc-cr16.c (getprocreg_image): Fix typo MAX_PREG ->
>> MAX_REG.
>> (getprocregp_image): Likewise.
>
> I've been going over testsuite results, and this change causes a gas
> testsuite failure. I believe we should have the following instead.
You are correct of course - thanks for catching this problem.
Cheers
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-11 9:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-05 11:01 PATCH: COMMITTED: Fix typos in tc-cr16.c Nick Clifton
2011-04-11 4:53 ` Alan Modra
2011-04-11 9:03 ` Nick Clifton
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).