Commit 291c0a12 by Rainer Orth Committed by Rainer Orth

re PR pch/14940 (PCH largefile test fails on various platforms)

	gcc:
	PR pch/14940
	* config/host-solaris.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Redefine
	to sol_gt_pch_get_address.
	(TRY_EMPTY_VM_SPACE): Define for all combinations of 32 and
	64-bit, SPARC and x86.
	(sol_gt_pch_get_address): New function.

	gcc/testsuite:
	PR pch/14940
	* gcc.dg/pch/pch.exp: Don't XFAIL largefile.c on i?86-*-solaris2.10.

From-SVN: r157141
parent 72a30e3c
2010-03-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR pch/14940
* config/host-solaris.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Redefine
to sol_gt_pch_get_address.
(TRY_EMPTY_VM_SPACE): Define for all combinations of 32 and
64-bit, SPARC and x86.
(sol_gt_pch_get_address): New function.
2010-03-01 Marco Poletti <poletti.marco@gmail.com> 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
* toplev.h (inform_n, error_n): Declare. * toplev.h (inform_n, error_n): Declare.
......
/* Solaris host-specific hook definitions. /* Solaris host-specific hook definitions.
Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Copyright (C) 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -25,9 +25,48 @@ ...@@ -25,9 +25,48 @@
#include "hosthooks-def.h" #include "hosthooks-def.h"
#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
#define HOST_HOOKS_GT_PCH_GET_ADDRESS sol_gt_pch_get_address
#undef HOST_HOOKS_GT_PCH_USE_ADDRESS #undef HOST_HOOKS_GT_PCH_USE_ADDRESS
#define HOST_HOOKS_GT_PCH_USE_ADDRESS sol_gt_pch_use_address #define HOST_HOOKS_GT_PCH_USE_ADDRESS sol_gt_pch_use_address
/* For various ports, try to guess a fixed spot in the vm space
that's probably free. Based on McDougall, Mauro, Solaris Internals, 2nd
ed., p.460-461, fig. 9-3, 9-4, 9-5. */
#if defined(__sparcv9__)
/* This low to avoid VA hole on UltraSPARC I/II. */
# define TRY_EMPTY_VM_SPACE 0x70000000000
#elif defined(__sparc__)
# define TRY_EMPTY_VM_SPACE 0x80000000
#elif defined(__x86_64__)
# define TRY_EMPTY_VM_SPACE 0x8000000000000000
#elif defined(__i386__)
# define TRY_EMPTY_VM_SPACE 0xB0000000
#else
# define TRY_EMPTY_VM_SPACE 0
#endif
/* Determine a location where we might be able to reliably allocate
SIZE bytes. FD is the PCH file, though we should return with the
file unmapped. */
static void *
sol_gt_pch_get_address (size_t size, int fd)
{
void *addr;
addr = mmap ((caddr_t) TRY_EMPTY_VM_SPACE, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE, fd, 0);
/* If we failed the map, that means there's *no* free space. */
if (addr == (void *) MAP_FAILED)
return NULL;
/* Unmap the area before returning. */
munmap ((caddr_t) addr, size);
return addr;
}
/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at /* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
mapping the data at BASE, -1 if we couldn't. */ mapping the data at BASE, -1 if we couldn't. */
......
...@@ -43,7 +43,6 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { ...@@ -43,7 +43,6 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
set test "largefile.c" set test "largefile.c"
set testh "largefile.hs" set testh "largefile.hs"
set f [open $test w] set f [open $test w]
puts $f "/* { dg-xfail-if \"PR 14940\" { \"i?86-*-solaris2.10\" } { \"*\" } { \"\" } } */"
puts $f "/* { dg-timeout-factor 4.0 } */" puts $f "/* { dg-timeout-factor 4.0 } */"
set v 0 set v 0
for { set v 0 } { $v < 10000 } { incr v } { for { set v 0 } { $v < 10000 } { incr v } {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment