From patchwork Thu Apr 18 10:49:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 237616 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id ACA132C01E4 for ; Thu, 18 Apr 2013 20:49:26 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=Wkt/6POhCN1irn5A1k 1qyjMUsDhk4NlJ4xllEp8dy/Slti+rZFUwm8mBt11S8WshYSm53cvdkNBD4FbL/h 3M1MiUE+PGtvnbjt17RkytyPQE1TzFqr/tfpJOaarbsoOqRYEXi7jZA5uRLWV+1A XgU7YaUmAp2w25qWuBEsGOIi0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=c5rybXuIlAxeLLjSriQiLfBb EJQ=; b=E/PTJqQ/IAvBgLppRJCdSTskVkPAnunMobnlQpWB4jlFjKXrwPynfom8 mRpX2pKK/rRL+PWxXDzsYd22pU83Fxyu1vqpuLSptTpI4ft4NOicBRFrtIK5EhEu rpE76kt4BM2X+9TCMxYT2ifLuuFOG6saVnf9DhmNROdcVEopkiA= Received: (qmail 10034 invoked by alias); 18 Apr 2013 10:49:19 -0000 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 Received: (qmail 10023 invoked by uid 89); 18 Apr 2013 10:49:19 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-pd0-f178.google.com (HELO mail-pd0-f178.google.com) (209.85.192.178) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 18 Apr 2013 10:49:14 +0000 Received: by mail-pd0-f178.google.com with SMTP id w11so1469383pde.37 for ; Thu, 18 Apr 2013 03:49:12 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.14.1 with SMTP id l1mr12988884pac.150.1366282152647; Thu, 18 Apr 2013 03:49:12 -0700 (PDT) Received: by 10.68.233.102 with HTTP; Thu, 18 Apr 2013 03:49:12 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Apr 2013 14:49:12 +0400 Message-ID: Subject: Re: [testsuite] Adding target nonpic to g++.dg/tm/pr47746.C From: Alexander Ivchenko To: Patrick Marlier Cc: GCC Patches , Aldy Hernandez Hi Patrick, I'm trying it on linux/x86_64 on trunk. Testing just by adding -fpic to the dg-options: testsuite/g++.dg/tm/pr47746.C:20:14: error: unsafe function call 'void Building::load(InputStream*)' within 'transaction_safe' function And the backtrace: #0 ipa_tm_diagnose_tm_safe (node=0x7ffff19a5940) at src/gcc/gcc/trans-mem.c:4499 #1 0x0000000000c6364b in ipa_tm_execute () at src/gcc/gcc/trans-mem.c:5323 #2 0x0000000000b66bce in execute_one_pass (pass=0x1a46d00) at src/gcc/gcc/passes.c:2331 #3 0x0000000000b6787c in execute_ipa_pass_list (pass=0x1a46d00) at src/gcc/gcc/passes.c:2688 in the code: 4499| for (e = node->callees; e ; e = e->next_callee) 4500| if (!is_tm_callable (e->callee->symbol.decl) 4501| && e->callee->local.tm_may_enter_irr) 4502+> error_at (gimple_location (e->call_stmt), 4503| "unsafe function call %qD within " 4504| "% function", e->callee->symbol.decl); AFAIU, The eventual reason for that error_at, as I wrote before, is the check: 4461| /* If we aren't seeing the final version of the function we don't 4462| know what it will contain at runtime. */ 4463| if (cgraph_function_body_availability (node) < AVAIL_AVAILABLE) 4464+> return true; 4465| (gdb) p cgraph_function_body_availability (node) $54 = AVAIL_OVERWRITABLE Sure I can file a PR If you think that the test was not supposed to fail with -fpic thanks, Alexander 2013/4/18 Patrick Marlier : > Hi Alexander, > > On Thu, Apr 11, 2013 at 11:37 AM, Alexander Ivchenko wrote: >> The same motivation as for: >> http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html >> >> "Since -fpic option is turned on by default in Android we have certain test >> fails. The reason for that is that those tests rely on the >> availability of functions, defined in them >> and with -fpic compiler conservatively assumes that they are >> AVAIL_OVERWRITABLE." >> >> In case of tm we have that in here: >> >> 4461| /* If we aren't seeing the final version of the function we don't >> 4462| know what it will contain at runtime. */ >> 4463| if (cgraph_function_body_availability (node) < AVAIL_AVAILABLE) >> 4464+> return true; >> 4465| >> >> (gdb) p cgraph_function_body_availability (node) >> $54 = AVAIL_OVERWRITABLE >> >> and so we have a testfail for Android. > > > Where/how does it fails? (backtrace?) I cannot reproduce with -fpic on > linux/x86. > > Actually the test is not supposed to fail even with pic. So maybe you > should open a PR. > > Thanks, > -- > Patrick Marlier --- a/gcc/testsuite/g++.dg/tm/pr47746.C +++ b/gcc/testsuite/g++.dg/tm/pr47746.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-fgnu-tm" } +// { dg-options "-fgnu-tm -fpic" } Here is the error msg: