aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libgo
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-05-17 17:03:43 -0700
committerBen Cheng <bccheng@google.com>2014-05-17 17:12:35 -0700
commit8c493ead6366b552adee796de296936b78f34c5a (patch)
tree4936e52fb9b84edbcd9293bd321027413d1835bf /gcc-4.9/libgo
parent9750bde7e561731ce8a07cdbd0165a688e74a696 (diff)
downloadtoolchain_gcc-8c493ead6366b552adee796de296936b78f34c5a.tar.gz
toolchain_gcc-8c493ead6366b552adee796de296936b78f34c5a.tar.bz2
toolchain_gcc-8c493ead6366b552adee796de296936b78f34c5a.zip
[4.9] Refresh GCC 4.9 to the 20140514 snapshot.
For critical bug fixes including devirtualization and codegen. Change-Id: I8138d3dc408fc12db5eecb01d2753d39219712f2
Diffstat (limited to 'gcc-4.9/libgo')
-rw-r--r--gcc-4.9/libgo/config.h.in3
-rwxr-xr-xgcc-4.9/libgo/configure2
-rw-r--r--gcc-4.9/libgo/configure.ac2
-rwxr-xr-xgcc-4.9/libgo/mksysinfo.sh39
-rw-r--r--gcc-4.9/libgo/runtime/mheap.c14
5 files changed, 56 insertions, 4 deletions
diff --git a/gcc-4.9/libgo/config.h.in b/gcc-4.9/libgo/config.h.in
index 73854351c..2ee0cfc24 100644
--- a/gcc-4.9/libgo/config.h.in
+++ b/gcc-4.9/libgo/config.h.in
@@ -192,6 +192,9 @@
/* Define to 1 if you have the `renameat' function. */
#undef HAVE_RENAMEAT
+/* Define to 1 if you have the <sched.h> header file. */
+#undef HAVE_SCHED_H
+
/* Define to 1 if you have the `sem_timedwait' function. */
#undef HAVE_SEM_TIMEDWAIT
diff --git a/gcc-4.9/libgo/configure b/gcc-4.9/libgo/configure
index f4b8c1044..1223204a2 100755
--- a/gcc-4.9/libgo/configure
+++ b/gcc-4.9/libgo/configure
@@ -14627,7 +14627,7 @@ no)
;;
esac
-for ac_header in sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h
+for ac_header in sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/gcc-4.9/libgo/configure.ac b/gcc-4.9/libgo/configure.ac
index 4480261a9..754e1906c 100644
--- a/gcc-4.9/libgo/configure.ac
+++ b/gcc-4.9/libgo/configure.ac
@@ -480,7 +480,7 @@ no)
;;
esac
-AC_CHECK_HEADERS(sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
+AC_CHECK_HEADERS(sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
diff --git a/gcc-4.9/libgo/mksysinfo.sh b/gcc-4.9/libgo/mksysinfo.sh
index 025729cca..bb6abfd04 100755
--- a/gcc-4.9/libgo/mksysinfo.sh
+++ b/gcc-4.9/libgo/mksysinfo.sh
@@ -163,6 +163,9 @@ cat > sysinfo.c <<EOF
#if defined(HAVE_NETINET_ICMP6_H)
#include <netinet/icmp6.h>
#endif
+#if defined(HAVE_SCHED_H)
+#include <sched.h>
+#endif
/* Constants that may only be defined as expressions on some systems,
expressions too complex for -fdump-go-spec to handle. These are
@@ -177,6 +180,18 @@ enum {
#ifdef TIOCSCTTY
TIOCSCTTY_val = TIOCSCTTY,
#endif
+#ifdef TIOCGPTN
+ TIOCGPTN_val = TIOCGPTN,
+#endif
+#ifdef TIOCSPTLCK
+ TIOCSPTLCK_val = TIOCSPTLCK,
+#endif
+#ifdef TIOCGDEV
+ TIOCGDEV_val = TIOCGDEV,
+#endif
+#ifdef TIOCSIG
+ TIOCSIG_val = TIOCSIG,
+#endif
};
EOF
@@ -775,6 +790,26 @@ if ! grep '^const TIOCSCTTY' ${OUT} >/dev/null 2>&1; then
echo 'const TIOCSCTTY = _TIOCSCTTY_val' >> ${OUT}
fi
fi
+if ! grep '^const TIOCGPTN' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCGPTN_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCGPTN = _TIOCGPTN_val' >> ${OUT}
+ fi
+fi
+if ! grep '^const TIOCSPTLCK' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCSPTLCK_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCSPTLCK = _TIOCSPTLCK_val' >> ${OUT}
+ fi
+fi
+if ! grep '^const TIOCGDEV' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCGDEV_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCGDEV = _TIOCGDEV_val' >> ${OUT}
+ fi
+fi
+if ! grep '^const TIOCSIG' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCSIG_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCSIG = _TIOCSIG_val' >> ${OUT}
+ fi
+fi
# The ioctl flags for terminal control
grep '^const _TC[GS]ET' gen-sysinfo.go | \
@@ -1130,6 +1165,10 @@ grep '^type _inotify_event ' gen-sysinfo.go | \
-e 's/\[0\]byte/[0]int8/' \
>> ${OUT}
+# The GNU/Linux CLONE flags.
+grep '^const _CLONE_' gen-sysinfo.go | \
+ sed -e 's/^\(const \)_\(CLONE_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+
# The Solaris 11 Update 1 _zone_net_addr_t struct.
grep '^type _zone_net_addr_t ' gen-sysinfo.go | \
sed -e 's/_in6_addr/[16]byte/' \
diff --git a/gcc-4.9/libgo/runtime/mheap.c b/gcc-4.9/libgo/runtime/mheap.c
index fee493c13..1b8ab7916 100644
--- a/gcc-4.9/libgo/runtime/mheap.c
+++ b/gcc-4.9/libgo/runtime/mheap.c
@@ -387,7 +387,7 @@ forcegchelper(void *vnote)
static uintptr
scavengelist(MSpan *list, uint64 now, uint64 limit)
{
- uintptr released, sumreleased;
+ uintptr released, sumreleased, start, end, pagesize;
MSpan *s;
if(runtime_MSpanList_IsEmpty(list))
@@ -400,7 +400,17 @@ scavengelist(MSpan *list, uint64 now, uint64 limit)
mstats.heap_released += released;
sumreleased += released;
s->npreleased = s->npages;
- runtime_SysUnused((void*)(s->start << PageShift), s->npages << PageShift);
+
+ start = s->start << PageShift;
+ end = start + (s->npages << PageShift);
+
+ // Round start up and end down to ensure we
+ // are acting on entire pages.
+ pagesize = getpagesize();
+ start = ROUND(start, pagesize);
+ end &= ~(pagesize - 1);
+ if(end > start)
+ runtime_SysUnused((void*)start, end - start);
}
}
return sumreleased;