From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7088 invoked by alias); 30 Oct 2008 11:24:03 -0000 Received: (qmail 7078 invoked by uid 22791); 30 Oct 2008 11:24:03 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 30 Oct 2008 11:23:59 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m9UB80w9007980; Thu, 30 Oct 2008 07:14:51 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m9UB13Kb026093; Thu, 30 Oct 2008 07:01:08 -0400 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.2/8.14.2/Submit) id m9UB13Nj020509; Thu, 30 Oct 2008 12:01:03 +0100 Date: Thu, 30 Oct 2008 12:54:00 -0000 From: Jakub Jelinek To: Andreas.Krebbel@de.ibm.com Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix gcc.dg/visibility-1{4,6}.c failures on s390-linux Message-ID: <20081030110103.GR14706@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01304.txt.bz2 Hi! These fail because foo is output through s390_output_pool_entry, not using expand_expr* nor output_operand, and so assemble_external isn't called on the referenced symbols, which means .hidden foo isn't emitted, eventhough the hidden symbol is referenced. Ok for trunk if it passes bootstrap/regtest? 2008-10-30 Jakub Jelinek * config/s390/s390.c (s390_mark_symbol_ref_as_used): New function. (s390_output_pool_entry): Call it through for_each_rtx. --- gcc/config/s390/s390.c.jj 2008-10-14 12:49:25.000000000 +0200 +++ gcc/config/s390/s390.c 2008-10-30 11:50:59.000000000 +0100 @@ -6664,6 +6664,24 @@ s390_chunkify_cancel (struct constant_po } } +/* Helper rtx-iteration-function for s390_output_pool_entry. Marks + SYMBOL_REFs as referenced through use of assemble_external. */ + +static int +s390_mark_symbol_ref_as_used (rtx *x, void *dummy ATTRIBUTE_UNUSED) +{ + /* If we have a used symbol, we may have to emit assembly + annotations corresponding to whether the symbol is external, weak + or has non-default visibility. */ + if (GET_CODE (*x) == SYMBOL_REF) + { + tree t = SYMBOL_REF_DECL (*x); + if (t) + assemble_external (t); + return -1; + } + return 0; +} /* Output the constant pool entry EXP in mode MODE with alignment ALIGN. */ @@ -6684,6 +6702,7 @@ s390_output_pool_entry (rtx exp, enum ma case MODE_INT: assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); + for_each_rtx (&exp, s390_mark_symbol_ref_as_used, NULL); break; default: Jakub