This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Work around a long long bug in gcc 2.96
- From: "H . J . Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Sat, 8 Jun 2002 09:53:25 -0700
- Subject: Re: PATCH: Work around a long long bug in gcc 2.96
- References: <20020608000939.A1342@lucon.org>
On Sat, Jun 08, 2002 at 12:09:39AM -0700, H . J . Lu wrote:
> gcc 2.96 miscompiles binutils in CVS on mips. I took a look at the
> asm output from gcc 3.1.1. It seems ok. This patch seems to work
> around the bug for gcc 2.96.
>
>
Here is an update.
H.J.
----
2002-06-08 H.J. Lu <hjl@gnu.org>
* elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
work around a long long bug in gcc 2.96 on mips.
--- binutils/bfd/elf.c.ll Fri Jun 7 18:00:09 2002
+++ binutils/bfd/elf.c Sat Jun 8 09:44:02 2002
@@ -4689,7 +4689,13 @@ copy_private_bfd_data (ibfd, obfd)
pointers that we are interested in. As these sections get assigned
to a segment, they are removed from this array. */
+#if __GNUC__ == 2 && __GNUC_MINOR__ == 96
+ /* Gcc 2.96 miscompiles this code on mips. Don't do casting here
+ to work around this long long bug. */
+ amt = section_count * sizeof (asection *);
+#else
amt = (bfd_size_type) section_count * sizeof (asection *);
+#endif
sections = (asection **) bfd_malloc (amt);
if (sections == NULL)
return false;