From 7650950668c2d19985a0cc6546c84e85be451ea1 Mon Sep 17 00:00:00 2001 From: doko Date: Tue, 27 May 2014 07:32:22 +0000 Subject: * Update to SVN 20140527 (r210956) from the gcc-4_8-branch. git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.8@7414 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca --- debian/changelog | 4 +- debian/patches/svn-updates.diff | 152 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 149 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c98477..e15cb39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ gcc-4.8 (4.8.3-2) unstable; urgency=medium - * Update to SVN 20140526 (r210209) from the gcc-4_8-branch. + * Update to SVN 20140527 (r210956) from the gcc-4_8-branch. - Fix PR target/61208. Closes: #748422. - -- Matthias Klose Mon, 26 May 2014 11:07:40 +0200 + -- Matthias Klose Tue, 27 May 2014 09:31:55 +0200 gcc-4.8 (4.8.3-1) unstable; urgency=medium diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff index aa3fd4c..11f552f 100644 --- a/debian/patches/svn-updates.diff +++ b/debian/patches/svn-updates.diff @@ -1,10 +1,10 @@ -# DP: updates from the 4.8 branch upto 20140526 (r210928). +# DP: updates from the 4.8 branch upto 20140527 (r210956). last_updated() { cat > ${dir}LAST_UPDATED < + + * gcc.target/powerpc/htm-ttest.c: New test. ++ + 2014-05-22 Release Manager + + * GCC 4.8.3 released. +Index: gcc/fortran/ChangeLog +=================================================================== +--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_3_release) ++++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch) +@@ -1,3 +1,10 @@ ++2014-05-26 Janne Blomqvist ++ ++ Backport from mainline ++ PR libfortran/61310 ++ * intrinsics.texi (CTIME): Remove mention of locale-dependent ++ behavior. + 2014-05-22 Release Manager @@ -156,11 +171,138 @@ Index: gcc/config/arm/arm.md ) (define_insn "*arm_cmpdi_zero" +Index: libgfortran/intrinsics/ctime.c +=================================================================== +--- a/src/libgfortran/intrinsics/ctime.c (.../tags/gcc_4_8_3_release) ++++ b/src/libgfortran/intrinsics/ctime.c (.../branches/gcc-4_8-branch) +@@ -31,31 +31,53 @@ + #include + + +-/* strftime-like function that fills a C string with %c format which +- is identical to ctime in the default locale. As ctime and ctime_r +- are poorly specified and their usage not recommended, the +- implementation instead uses strftime. */ ++/* Maximum space a ctime-like string might need. A "normal" ctime ++ string is 26 bytes, and in our case 24 bytes as we don't include ++ the trailing newline and null. However, the longest possible year ++ number is -2,147,481,748 (1900 - 2,147,483,648, since tm_year is a ++ 32-bit signed integer) so an extra 7 bytes are needed. */ ++#define CTIME_BUFSZ 31 + +-static size_t +-strctime (char *s, size_t max, const time_t *timep) ++ ++/* Thread-safe ctime-like function that fills a Fortran ++ string. ctime_r is a portability headache and marked as obsolescent ++ in POSIX 2008, which recommends strftime in its place. However, ++ strftime(..., "%c",...) doesn't produce ctime-like output on ++ MinGW, so do it manually with snprintf. */ ++ ++static int ++gf_ctime (char *s, size_t max, const time_t timev) + { + struct tm ltm; + int failed; ++ char buf[CTIME_BUFSZ + 1]; + /* Some targets provide a localtime_r based on a draft of the POSIX + standard where the return type is int rather than the + standardized struct tm*. */ +- __builtin_choose_expr (__builtin_classify_type (localtime_r (timep, <m)) ++ __builtin_choose_expr (__builtin_classify_type (localtime_r (&timev, <m)) + == 5, +- failed = localtime_r (timep, <m) == NULL, +- failed = localtime_r (timep, <m) != 0); ++ failed = localtime_r (&timev, <m) == NULL, ++ failed = localtime_r (&timev, <m) != 0); + if (failed) +- return 0; +- return strftime (s, max, "%c", <m); ++ goto blank; ++ int n = snprintf (buf, sizeof (buf), ++ "%3.3s %3.3s%3d %.2d:%.2d:%.2d %d", ++ "SunMonTueWedThuFriSat" + ltm.tm_wday * 3, ++ "JanFebMarAprMayJunJulAugSepOctNovDec" + ltm.tm_mon * 3, ++ ltm.tm_mday, ltm.tm_hour, ltm.tm_min, ltm.tm_sec, ++ 1900 + ltm.tm_year); ++ if (n < 0) ++ goto blank; ++ if ((size_t) n <= max) ++ { ++ cf_strcpy (s, max, buf); ++ return n; ++ } ++ blank: ++ memset (s, ' ', max); ++ return 0; + } + +-/* In the default locale, the date and time representation fits in 26 +- bytes. However, other locales might need more space. */ +-#define CSZ 100 + + extern void fdate (char **, gfc_charlen_type *); + export_proto(fdate); +@@ -64,8 +86,8 @@ + fdate (char ** date, gfc_charlen_type * date_len) + { + time_t now = time(NULL); +- *date = xmalloc (CSZ); +- *date_len = strctime (*date, CSZ, &now); ++ *date = xmalloc (CTIME_BUFSZ); ++ *date_len = gf_ctime (*date, CTIME_BUFSZ, now); + } + + +@@ -76,10 +98,7 @@ + fdate_sub (char * date, gfc_charlen_type date_len) + { + time_t now = time(NULL); +- char *s = xmalloc (date_len + 1); +- size_t n = strctime (s, date_len + 1, &now); +- fstrcpy (date, date_len, s, n); +- free (s); ++ gf_ctime (date, date_len, now); + } + + +@@ -91,8 +110,8 @@ + PREFIX(ctime) (char ** date, gfc_charlen_type * date_len, GFC_INTEGER_8 t) + { + time_t now = t; +- *date = xmalloc (CSZ); +- *date_len = strctime (*date, CSZ, &now); ++ *date = xmalloc (CTIME_BUFSZ); ++ *date_len = gf_ctime (*date, CTIME_BUFSZ, now); + } + + +@@ -103,8 +122,5 @@ + ctime_sub (GFC_INTEGER_8 * t, char * date, gfc_charlen_type date_len) + { + time_t now = *t; +- char *s = xmalloc (date_len + 1); +- size_t n = strctime (s, date_len + 1, &now); +- fstrcpy (date, date_len, s, n); +- free (s); ++ gf_ctime (date, date_len, now); + } Index: libgfortran/ChangeLog =================================================================== --- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_3_release) +++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch) -@@ -1,3 +1,10 @@ +@@ -1,3 +1,21 @@ ++2014-05-26 Janne Blomqvist ++ ++ Backport from mainline ++ PR libfortran/61310 ++ * intrinsics/ctime.c (strctime): Rename to gf_ctime, use snprintf ++ instead of strftime. ++ (fdate): Use gf_ctime. ++ (fdate_sub): Likewise. ++ (ctime): Likewise. ++ (ctime_sub): Likewise. ++ +2014-05-25 Janne Blomqvist + + Backport from trunk. -- cgit v1.2.3