Help the compiler recognize unreachable code on 32-bit machines.

2007-10-16  Ulrich Drepper  <drepper@redhat.com>

	* time/tzfile.c (__tzfile_read): Help the compiler recognize
	unreachable code on 32-bit machines.
This commit is contained in:
Ulrich Drepper 2007-10-16 23:25:46 +00:00
parent 800d6f9ee8
commit 6a649d25bb
3 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2007-10-16 Ulrich Drepper <drepper@redhat.com>
* time/tzfile.c (__tzfile_read): Help the compiler recognize
unreachable code on 32-bit machines.
2007-10-16 Jakub Jelinek <jakub@redhat.com> 2007-10-16 Jakub Jelinek <jakub@redhat.com>
[BZ #5184] [BZ #5184]

View File

@ -4,8 +4,8 @@
if test "$usetls" != no; then if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and # Check for support of thread-local storage handling in assembler and
# linker. # linker.
echo "$as_me:$LINENO: checking for i386 TLS support" >&5 { echo "$as_me:$LINENO: checking for i386 TLS support" >&5
echo $ECHO_N "checking for i386 TLS support... $ECHO_C" >&6 echo $ECHO_N "checking for i386 TLS support... $ECHO_C" >&6; }
if test "${libc_cv_386_tls+set}" = set; then if test "${libc_cv_386_tls+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
@ -37,8 +37,8 @@ else
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $libc_cv_386_tls" >&5 { echo "$as_me:$LINENO: result: $libc_cv_386_tls" >&5
echo "${ECHO_T}$libc_cv_386_tls" >&6 echo "${ECHO_T}$libc_cv_386_tls" >&6; }
if test $libc_cv_386_tls = yes; then if test $libc_cv_386_tls = yes; then
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define HAVE_TLS_SUPPORT 1 #define HAVE_TLS_SUPPORT 1

View File

@ -243,7 +243,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
& ~(__alignof__ (struct leap) - 1)); & ~(__alignof__ (struct leap) - 1));
leaps_idx = total_size; leaps_idx = total_size;
total_size += num_leaps * sizeof (struct leap); total_size += num_leaps * sizeof (struct leap);
tzspec_len = (trans_width == 8 tzspec_len = (sizeof (time_t) == 8 && trans_width == 8
? st.st_size - (ftello (f) ? st.st_size - (ftello (f)
+ num_transitions * (8 + 1) + num_transitions * (8 + 1)
+ num_types * 6 + num_types * 6
@ -263,14 +263,14 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
types = (struct ttinfo *) ((char *) transitions + types_idx); types = (struct ttinfo *) ((char *) transitions + types_idx);
zone_names = (char *) types + num_types * sizeof (struct ttinfo); zone_names = (char *) types + num_types * sizeof (struct ttinfo);
leaps = (struct leap *) ((char *) transitions + leaps_idx); leaps = (struct leap *) ((char *) transitions + leaps_idx);
if (trans_width == 8) if (sizeof (time_t) == 8 && trans_width == 8)
tzspec = (char *) leaps + num_leaps * sizeof (struct leap) + extra; tzspec = (char *) leaps + num_leaps * sizeof (struct leap) + extra;
else else
tzspec = NULL; tzspec = NULL;
if (extra > 0) if (extra > 0)
*extrap = (char *) &leaps[num_leaps]; *extrap = (char *) &leaps[num_leaps];
if (sizeof (time_t) == 4 || trans_width == 8) if (sizeof (time_t) == 4 || __builtin_expect (trans_width == 8, 1))
{ {
if (__builtin_expect (fread_unlocked (transitions, trans_width + 1, if (__builtin_expect (fread_unlocked (transitions, trans_width + 1,
num_transitions, f) num_transitions, f)