* PATCH: add missing `return' to cgen_get_insn_value
@ 2001-02-21 12:30 Greg McGary
2001-02-21 13:45 ` Ben Elliston
2001-02-21 14:11 ` Frank Ch. Eigler
0 siblings, 2 replies; 7+ messages in thread
From: Greg McGary @ 2001-02-21 12:30 UTC (permalink / raw)
To: cgen
Here's a fun one that worked fine on ix86 hosts but
returned bad data on SPARC.
OK to commit?
2001-02-21 Greg McGary <greg@mcgary.org>
* cgen-opc.c (cgen_get_insn_value): Add missing `return'.
Index: cgen-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-opc.c,v
retrieving revision 1.5
diff -u -p -r1.5 cgen-opc.c
--- cgen-opc.c 2001/01/02 16:34:07 1.5
+++ cgen-opc.c 2001/02/21 20:27:13
@@ -1,6 +1,6 @@
/* CGEN generic opcode support.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU Binutils and GDB, the GNU debugger.
@@ -374,7 +374,7 @@ cgen_get_insn_value (cd, buf, length)
unsigned char *buf;
int length;
{
- bfd_get_bits (buf, length, cd->insn_endian == CGEN_ENDIAN_BIG);
+ return bfd_get_bits (buf, length, cd->insn_endian == CGEN_ENDIAN_BIG);
}
/* Cover function to store an insn value properly byteswapped. */
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: add missing `return' to cgen_get_insn_value
2001-02-21 12:30 PATCH: add missing `return' to cgen_get_insn_value Greg McGary
@ 2001-02-21 13:45 ` Ben Elliston
2001-02-21 14:11 ` Frank Ch. Eigler
1 sibling, 0 replies; 7+ messages in thread
From: Ben Elliston @ 2001-02-21 13:45 UTC (permalink / raw)
To: Greg McGary; +Cc: cgen
>>>>> "Greg" == Greg McGary <greg@mcgary.org> writes:
Greg> Here's a fun one that worked fine on ix86 hosts but
Greg> returned bad data on SPARC.
Greg> OK to commit?
Please do.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: add missing `return' to cgen_get_insn_value
2001-02-21 12:30 PATCH: add missing `return' to cgen_get_insn_value Greg McGary
2001-02-21 13:45 ` Ben Elliston
@ 2001-02-21 14:11 ` Frank Ch. Eigler
2001-02-21 14:18 ` Greg McGary
2001-02-21 14:28 ` Greg McGary
1 sibling, 2 replies; 7+ messages in thread
From: Frank Ch. Eigler @ 2001-02-21 14:11 UTC (permalink / raw)
To: Greg McGary; +Cc: cgen
Hi -
On Wed, Feb 21, 2001 at 01:29:59PM -0700, Greg McGary wrote:
: Here's a fun one that worked fine on ix86 hosts but
: returned bad data on SPARC.
:
: OK to commit?
:
: 2001-02-21 Greg McGary <greg@mcgary.org>
:
: * cgen-opc.c (cgen_get_insn_value): Add missing `return'.
Yes, please! As it turns out, our very own Jeff Johnston found
this same bug, a few minutes ago.
- FChE
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE6lD0AVZbdDOm/ZT0RAtYxAJ4uSqIucq9a4vbQFvNWqeh45yaBCACfTnVy
s1hwhFDZ8idPwLR9bwYw/Sc=
=mNKw
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: add missing `return' to cgen_get_insn_value
2001-02-21 14:11 ` Frank Ch. Eigler
@ 2001-02-21 14:18 ` Greg McGary
2001-02-21 16:23 ` matthew green
2001-02-21 14:28 ` Greg McGary
1 sibling, 1 reply; 7+ messages in thread
From: Greg McGary @ 2001-02-21 14:18 UTC (permalink / raw)
To: Frank Ch. Eigler; +Cc: cgen
"Frank Ch. Eigler" <fche@redhat.com> writes:
> Yes, please! As it turns out, our very own Jeff Johnston found
> this same bug, a few minutes ago.
I committed it approx 20 minutes ago.
I guess people don't use machines with register windows very often for
hosting CGEN tools, eh?
I had been using SPARC for hosting my port for months, but only
recently started using & debugging relocations. The bug surfaced in a
fixup that was supposed to write only the low-order 16 bits of an
insn. It clobbered the entire insn because it failed to properly read
during the read-fixup-write cycle.
Greg
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: add missing `return' to cgen_get_insn_value
2001-02-21 14:11 ` Frank Ch. Eigler
2001-02-21 14:18 ` Greg McGary
@ 2001-02-21 14:28 ` Greg McGary
2001-02-21 15:51 ` Ben Elliston
1 sibling, 1 reply; 7+ messages in thread
From: Greg McGary @ 2001-02-21 14:28 UTC (permalink / raw)
To: Frank Ch. Eigler; +Cc: cgen
"Frank Ch. Eigler" <fche@redhat.com> writes:
> Yes, please! As it turns out, our very own Jeff Johnston found
> this same bug, a few minutes ago.
The puzzling thing is that no warnings surfaced when compiled with
`-W -Wall' from
gcc version 2.96 20000731 (Red Hat Linux 7.0)
I did get a warning from
gcc version 2.95.2 19991024 (release)
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
I haven't tried a pre-3.0 GCC, so I don't know if it's still a
regression.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: add missing `return' to cgen_get_insn_value
2001-02-21 14:28 ` Greg McGary
@ 2001-02-21 15:51 ` Ben Elliston
0 siblings, 0 replies; 7+ messages in thread
From: Ben Elliston @ 2001-02-21 15:51 UTC (permalink / raw)
To: Greg McGary; +Cc: Frank Ch. Eigler, cgen
>>>>> "Greg" == Greg McGary <greg@mcgary.org> writes:
Greg> The puzzling thing is that no warnings surfaced when compiled with
Greg> `-W -Wall' from
Greg> gcc version 2.96 20000731 (Red Hat Linux 7.0)
That is surprising. A function with a return type failing to return a
value is a pretty common warning!
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* re: PATCH: add missing `return' to cgen_get_insn_value
2001-02-21 14:18 ` Greg McGary
@ 2001-02-21 16:23 ` matthew green
0 siblings, 0 replies; 7+ messages in thread
From: matthew green @ 2001-02-21 16:23 UTC (permalink / raw)
To: Greg McGary; +Cc: cgen
I guess people don't use machines with register windows very often for
hosting CGEN tools, eh?
I had been using SPARC for hosting my port for months, but only
recently started using & debugging relocations. The bug surfaced in a
fixup that was supposed to write only the low-order 16 bits of an
insn. It clobbered the entire insn because it failed to properly read
during the read-fixup-write cycle.
actually, 95% of my work with cgen is under solaris 2.6/sparc.
.mrg.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-02-21 16:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-21 12:30 PATCH: add missing `return' to cgen_get_insn_value Greg McGary
2001-02-21 13:45 ` Ben Elliston
2001-02-21 14:11 ` Frank Ch. Eigler
2001-02-21 14:18 ` Greg McGary
2001-02-21 16:23 ` matthew green
2001-02-21 14:28 ` Greg McGary
2001-02-21 15:51 ` Ben Elliston
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).