This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Work around a long long bug in gcc 2.96


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.


H.J.
---
2002-06-08  H.J. Lu <hjl@gnu.org>

	* elf.c (copy_private_bfd_data): Do casting 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 00:06:32 2002
@@ -4690,7 +4690,13 @@ copy_private_bfd_data (ibfd, obfd)
 	 to a segment, they are removed from this array.  */
 
       amt = (bfd_size_type) section_count * sizeof (asection *);
+#if __GNUC__ == 2 && __GNUC_MINOR__ == 96
+      /* Gcc 2.96 miscompiles this code on mips. We do some extra
+	 casting to work around this long long bug.  */
+      sections = (asection **) bfd_malloc ((bfd_size_type) (size_t) amt);
+#else
       sections = (asection **) bfd_malloc (amt);
+#endif
       if (sections == NULL)
 	return false;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]