From patchwork Wed Feb 2 16:06:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 81478 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id ABE5FB7109 for ; Thu, 3 Feb 2011 03:06:48 +1100 (EST) Received: (qmail 8415 invoked by alias); 2 Feb 2011 16:06:45 -0000 Received: (qmail 8399 invoked by uid 22791); 2 Feb 2011 16:06:43 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Feb 2011 16:06:38 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 05F89D8C for ; Wed, 2 Feb 2011 17:06:36 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id h-Hp-4PkbbPE for ; Wed, 2 Feb 2011 17:06:29 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 923D1D8B for ; Wed, 2 Feb 2011 17:06:29 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p12G6S32014721; Wed, 2 Feb 2011 17:06:28 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: Cleanup i386/sysv4.h Date: Wed, 02 Feb 2011 17:06:28 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Prompted by the discussion in this thread http://gcc.gnu.org/ml/gcc-patches/2011-02/msg00018.html it turned out that the definition of ASM_OUTPUT_ASCII is O(n^4) and unnecessary since the elfos.h default works. Since i386/sysv4.h is only used by Solaris 2/x86, I'll install the following patch once Solaris 9/x86 testing has completed: * SUBTARGET_RETURN_IN_MEMORY is undefined again in i386/sol2.h, so there's no point in defining it at all. * TARGET_VERSION is wrong for the only remaining user, and should go anyway. * ASM_OUTPUT_ASCII prompted this cleanup. While I cannot currently test Solaris 8/x86, I don't expect problems. i386-pc-solaris2.10 and i386-pc-solaris2.11 bootstraps with both Sun as and gas completed without regressions and the testcase $ cc1 gcc.c-torture/compile/pr46534.c -O3 -o /dev/null was sped up by a factor of 20 to 36 depending on CPU. Rainer 2011-02-02 Rainer Orth * config/i386/sysv4.h (TARGET_VERSION): Remove. (SUBTARGET_RETURN_IN_MEMORY): Remove. (ASM_OUTPUT_ASCII): Remove. * config/i386/sol2.h (SUBTARGET_RETURN_IN_MEMORY): Remove #undef. diff -r 1d2a5939dcf3 gcc/config/i386/sol2.h --- a/gcc/config/i386/sol2.h Fri Jan 28 16:26:21 2011 +0100 +++ b/gcc/config/i386/sol2.h Wed Feb 02 14:35:41 2011 +0100 @@ -1,6 +1,6 @@ /* Target definitions for GCC for Intel 80386 running Solaris 2 Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Fred Fish (fnf@cygnus.com). This file is part of GCC. @@ -137,9 +137,6 @@ /* Register the Solaris-specific #pragma directives. */ #define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas () -/* Undo i386/sysv4.h version. */ -#undef SUBTARGET_RETURN_IN_MEMORY - /* Augment i386/unix.h version to return 8-byte vectors in memory, matching Sun Studio compilers until version 12, the only ones supported on Solaris 8 and 9. */ diff -r 1d2a5939dcf3 gcc/config/i386/sysv4.h --- a/gcc/config/i386/sysv4.h Fri Jan 28 16:26:21 2011 +0100 +++ b/gcc/config/i386/sysv4.h Wed Feb 02 14:35:41 2011 +0100 @@ -1,5 +1,6 @@ /* Target definitions for GCC for Intel 80386 running System V.4 - Copyright (C) 1991, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 1991, 2001, 2002, 2007, 2008, 2011 + Free Software Foundation, Inc. Written by Ron Guilmette (rfg@netcom.com). @@ -19,16 +20,6 @@ along with GCC; see the file COPYING3. If not see . */ - -#define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)"); - -/* The svr4 ABI for the i386 says that records and unions are returned - in memory. */ - -#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \ - (TYPE_MODE (TYPE) == BLKmode \ - || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8)); - /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ @@ -39,56 +30,6 @@ #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n] -/* The routine used to output sequences of byte values. We use a special - version of this for most svr4 targets because doing so makes the - generated assembly code more compact (and thus faster to assemble) - as well as more readable. Note that if we find subparts of the - character sequence which end with NUL (and which are shorter than - STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */ - -#undef ASM_OUTPUT_ASCII -#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ - do \ - { \ - const unsigned char *_ascii_bytes = \ - (const unsigned char *) (STR); \ - const unsigned char *limit = _ascii_bytes + (LENGTH); \ - unsigned bytes_in_chunk = 0; \ - for (; _ascii_bytes < limit; _ascii_bytes++) \ - { \ - const unsigned char *p; \ - if (bytes_in_chunk >= 64) \ - { \ - fputc ('\n', (FILE)); \ - bytes_in_chunk = 0; \ - } \ - for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \ - continue; \ - if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT) \ - { \ - if (bytes_in_chunk > 0) \ - { \ - fputc ('\n', (FILE)); \ - bytes_in_chunk = 0; \ - } \ - ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \ - _ascii_bytes = p; \ - } \ - else \ - { \ - if (bytes_in_chunk == 0) \ - fputs (ASM_BYTE, (FILE)); \ - else \ - fputc (',', (FILE)); \ - fprintf ((FILE), "0x%02x", *_ascii_bytes); \ - bytes_in_chunk += 5; \ - } \ - } \ - if (bytes_in_chunk > 0) \ - fputc ('\n', (FILE)); \ - } \ - while (0) - /* A C statement (sans semicolon) to output to the stdio stream FILE the assembler definition of uninitialized global DECL named NAME whose size is SIZE bytes and alignment is ALIGN bytes.