From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19246 invoked by alias); 4 May 2004 00:21:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 19080 invoked from network); 4 May 2004 00:21:39 -0000 Received: from unknown (HELO mx2.redhat.com) (66.187.237.31) by sources.redhat.com with SMTP; 4 May 2004 00:21:39 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.12.10/8.12.10) with ESMTP id i440KVxF007749; Mon, 3 May 2004 20:20:31 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i440LSw05750; Mon, 3 May 2004 20:21:28 -0400 Received: from [172.16.25.141] (dhcp-172-16-25-141.sfbay.redhat.com [172.16.25.141]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i440LSC11940; Mon, 3 May 2004 17:21:28 -0700 Subject: [PATCH] From: Eric Christopher To: gcc-patches@gcc.gnu.org Cc: uweigand@de.ibm.com Content-Type: text/plain Message-Id: <1083630087.32152.26.camel@dzur.sfbay.redhat.com> Mime-Version: 1.0 Date: Tue, 04 May 2004 00:26:00 -0000 Content-Transfer-Encoding: 7bit X-RedHat-Spam-Score: 0 X-SW-Source: 2004-05/txt/msg00133.txt.bz2 Having lots of problems with the tpf tracing functions until it was realized that they don't actually affect anything and don't need standard call mechanisms for save and restore either, just execute. We still use register 1 though so some of the code in s390_emit_pro/epilogue is still necessary. This appears to fix various problems seen building glibc for the tpfOS. Tested on s390x-ibm-tpf by building cc1 and testing various testcases. Doesn't affect s390-linux at all, but cc1 was also built there to make sure. OK? -eric -- Eric Christopher 2004-05-03 Eric Christopher * config/s390/s390.c (s390_emit_prologue): Call unspec tpf prologue insn instead of setting up call. (s390_emit_epilogue): Ditto. * config/s390/s390.md (prologue_tpf, epilogue_tpf): New patterns. (define_constants): Add numbers for above patterns. Index: s390.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v retrieving revision 1.142 diff -u -p -w -r1.142 s390.c --- s390.c 30 Apr 2004 16:40:22 -0000 1.142 +++ s390.c 4 May 2004 00:11:42 -0000 @@ -5683,11 +5683,9 @@ s390_emit_prologue (void) { /* Generate a BAS instruction to serve as a function entry intercept to facilitate the use of tracing - algorithms located at the branch target. + algorithms located at the branch target. */ - This must use register 1. */ - s390_emit_call (GEN_INT (0xfe0), NULL_RTX, NULL_RTX, - gen_rtx_REG (Pmode, 1)); + emit_insn (gen_prologue_tpf ()); /* Emit a blockage here so that all code lies between the profiling mechanisms. */ @@ -5710,16 +5708,13 @@ s390_emit_epilogue (bool sibcall) /* Generate a BAS instruction to serve as a function entry intercept to facilitate the use of tracing - algorithms located at the branch target. - - This must use register 1. */ + algorithms located at the branch target. */ /* Emit a blockage here so that all code lies between the profiling mechanisms. */ emit_insn (gen_blockage ()); - s390_emit_call (GEN_INT (0xfe6), NULL_RTX, NULL_RTX, - gen_rtx_REG (Pmode, 1)); + emit_insn (gen_epilogue_tpf ()); } /* Check whether to use frame or stack pointer for restore. */ Index: s390.md =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v retrieving revision 1.108 diff -u -p -w -r1.108 s390.md --- s390.md 30 Apr 2004 16:40:22 -0000 1.108 +++ s390.md 4 May 2004 00:11:43 -0000 @@ -118,6 +118,10 @@ [; Blockage (UNSPECV_BLOCKAGE 0) + ; TPF Support + (UNSPECV_TPF_PROLOGUE 20) + (UNSPECV_TPF_EPILOGUE 21) + ; Literal pool (UNSPECV_POOL 200) (UNSPECV_POOL_START 201) @@ -7522,10 +7526,23 @@ "" "s390_emit_prologue (); DONE;") +(define_insn "prologue_tpf" + [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)] + "TARGET_TPF" + "bas\t%%r1,4064" + [(set_attr "type" "jsr")]) + (define_expand "epilogue" [(use (const_int 1))] "" "s390_emit_epilogue (false); DONE;") + +(define_insn "epilogue_tpf" + [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)] + "TARGET_TPF" + "bas\t%%r1,4070" + [(set_attr "type" "jsr")]) + (define_expand "sibcall_epilogue" [(use (const_int 0))]