From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67495 invoked by alias); 29 Feb 2016 14:33:33 -0000 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 Received: (qmail 67479 invoked by uid 89); 29 Feb 2016 14:33:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=D*foss.arm.com, Christophe, kyrylo.tkachov@foss.arm.com, kyrylotkachovfossarmcom X-HELO: mail-qg0-f54.google.com Received: from mail-qg0-f54.google.com (HELO mail-qg0-f54.google.com) (209.85.192.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 29 Feb 2016 14:33:31 +0000 Received: by mail-qg0-f54.google.com with SMTP id y9so117651778qgd.3 for ; Mon, 29 Feb 2016 06:33:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=dhSKiaq0EFdtFP82NpVodokakOYCeOnNX5Mv7GiP2Kc=; b=enUG5QEIjSrnzrBMHFv3B+wyWG2DlBo9EsFXLqX9Jw+NxOOueyhtQQlpIoYITq1F9l heis52L+wV5O8JY34whi2tNDS9EuXM0FCFcscjxeinbTA3MG3lajBS2s0FcfbzfRpqMH rMM62VCRoMDDWo4F+ayJM/3d3OiOAYAO8ifLWnnYNkH6jQ075FlDud4FmByZFP+4KrlI gaujIq1AJWsFrJuuxMjKMs6L/bpZjVTOgjxmJALkg7AVuZx9I8lRBxrtOWTpmkx81B+n u/aX0pTKCU2tBRpI3W8wMy1/bCnzbb2eo4+WDkVDtGyn8UgVcbzXUMR87fcuYXB6V3+B TEZQ== X-Gm-Message-State: AD7BkJKZNZJeGD3EIw0XfZKi4kptlrGatBzCHaI9r+ErqDfFUG3s/Ii/mQu587FEZQ4hCNxsOIqyUwVCwuylpP9c MIME-Version: 1.0 X-Received: by 10.140.28.52 with SMTP id 49mr19344468qgy.36.1456756409146; Mon, 29 Feb 2016 06:33:29 -0800 (PST) Received: by 10.140.22.164 with HTTP; Mon, 29 Feb 2016 06:33:29 -0800 (PST) In-Reply-To: <56D4558D.3000106@foss.arm.com> References: <56CEDFB5.8050707@foss.arm.com> <20160226155131.GE40219@arm.com> <56D4558D.3000106@foss.arm.com> Date: Mon, 29 Feb 2016 14:33:00 -0000 Message-ID: Subject: Re: [PATCH][AArch64] Set TREE_TARGET_GLOBALS in aarch64_set_current_function when new tree is the default node to recalculate optab availability From: Christophe Lyon To: Kyrill Tkachov Cc: James Greenhalgh , GCC Patches , Marcus Shawcroft , Richard Earnshaw Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg01948.txt.bz2 On 29 February 2016 at 15:28, Kyrill Tkachov wrote: > Hi Crhistophe, > > > On 29/02/16 14:10, Christophe Lyon wrote: >> >> On 26 February 2016 at 16:51, James Greenhalgh >> wrote: >>> >>> On Thu, Feb 25, 2016 at 11:04:21AM +0000, Kyrill Tkachov wrote: >>>> >>>> Hi all, >>>> >>>> Seems like aarch64 is suffering from something similar to PR 69245 as >>>> well. >>>> If a target pragma sets the target state to the same as the >>>> target_option_default_node the node is just a pointer to >>>> target_option_default_node rather than a distinct identical node. So we >>>> must >>>> still restore the target globals even when setting to >>>> target_option_default_node in order to force the midend to recompute the >>>> availability of various optabs. >>>> >>>> If we don't do it, we can get in a problem like in the testcase where >>>> the >>>> isa_flags are all set correctly, but the optab HAVE_* predicates have >>>> not >>>> been recomputed. >>>> >>>> There is also a related issue present when popping/resetting target >>>> pragmas >>>> for which I'll send out a patch separately. >>>> >>>> Bootstrapped and tested on aarch64. >>>> >>>> Ok for trunk? >>> >>> OK. >>> >> Hi Kyrill, >> >> Since this patch, I'm seeing: >> gcc.dg/torture/pr52429.c -O2 -flto -fno-use-linker-plugin >> -flto-partition=none (internal compiler error) >> on target aarch64-none-linux-gnu >> >> The log has: >> spawn -ignore SIGHUP >> >> /aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/gcc3/gcc/xgcc >> -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/gcc >> 3/gcc/ >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/torture/pr52429.c >> -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -flto >> -fno-use-linker-pl >> ugin -flto-partition=none -g -ftree-parallelize-loops=4 >> -DSTACK_SIZE=16384 -S -o pr52429.s >> >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/torture/pr52429.c: >> In function 'foo': >> >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/torture/pr52429.c:24:1: >> internal compiler error: Segmentation fault >> 0xade075 crash_signal >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/toplev.c:335 >> 0x91f88e record_operand_costs >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/ira-costs.c:1293 >> 0x91fdba scan_one_insn >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/ira-costs.c:1471 >> 0x91fdba process_bb_for_costs >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/ira-costs.c:1592 >> 0x9214e7 find_costs_and_classes >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/ira-costs.c:1699 >> 0x922552 ira_set_pseudo_classes(bool, _IO_FILE*) >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/ira-costs.c:2239 >> 0x1061ecd alloc_global_sched_pressure_data >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/haifa-sched.c:7244 >> 0x1061ecd sched_init() >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/haifa-sched.c:7394 >> 0x10679ed haifa_sched_init() >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/haifa-sched.c:7406 >> 0xa84fae schedule_insns() >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/sched-rgn.c:3504 >> 0xa85864 rest_of_handle_sched >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/sched-rgn.c:3717 >> 0xa85864 execute >> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/sched-rgn.c:3825 >> >> Don't you see this regression on your side? > > > I've reproduced it just now. > I had not seen it initially because the test requires a pthread target, > so it was marked UNSUPPORTED when I tested aarch64-none-elf :( That's what I noticed too > But this looks like a latent bug elsewhere. > I'll try to investigate, can you please open a PR? Sure, this is PR 70016: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70016 Christophe > Thanks, > Kyrill > > >> Thanks, >> >> Christophe. >> >> >> >>> Thanks, >>> James >>> >>>> Thanks, >>>> Kyrill >>>> >>>> >>>> 2016-02-25 Kyrylo Tkachov >>>> >>>> PR target/69245 >>>> * config/aarch64/aarch64.c (aarch64_set_current_function): >>>> Save/restore >>>> target globals when switching to target_option_default_node. >>>> >>>> 2016-02-25 Kyrylo Tkachov >>>> >>>> PR target/69245 >>>> * gcc.target/aarch64/pr69245_1.c: New test. >>> >>> >