From patchwork Fri Jan 27 16:53:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 720857 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v94d20gH8z9tkF for ; Sat, 28 Jan 2017 03:54:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZrcVZFTI"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=PkmeBg5oiHr6q5ctoQ0WACwTPnPvrdl3odAyoCE3041OVDBayC elcyZkJmGfz6dpPODlZSdleYdMNRhniS+bba41OIEAMBYDmqATzzy2tn9d1dpJ2b Vry0VJpDGx9sQu1dMbsfW6iji5UqsNDfVpIT51iN4DDy4DlY0IwEthbgk= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=7XMZjt0732mdKMFl2FpxqwjwgLA=; b=ZrcVZFTIUjN4y6ANq6Gl ++SCol/rrn4HKICahXfJxJlS3yVOuME3lu4I3CT75lVi5W1GaSuDsxk5qlqvXk8r fqAJtTEsXS4CtUi6JsHNWWsVhv98nyN0gzGY5YPXcl4PZGW4V6c4VzmoY3Xpi+bR rogOo85QoIxBwOjMk4p/wAU= Received: (qmail 12176 invoked by alias); 27 Jan 2017 16:54:05 -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 12163 invoked by uid 89); 27 Jan 2017 16:54:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=BAYES_00, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jan 2017 16:53:55 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9B743DBCE for ; Fri, 27 Jan 2017 16:53:54 +0000 (UTC) Received: from [10.10.116.55] (ovpn-116-55.rdu2.redhat.com [10.10.116.55]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0RGrpHp017928 for ; Fri, 27 Jan 2017 11:53:52 -0500 To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: One more patch for PR79131 Message-ID: <21fe5264-227d-edc7-8a42-db715a3ce7c0@redhat.com> Date: Fri, 27 Jan 2017 11:53:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch permits to compile last 3 test cases on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79131 The patch was successfully bootstrapped and tested on x86-64. Committed as rev. 244989. Index: ChangeLog =================================================================== --- ChangeLog (revision 244987) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2017-01-27 Vladimir Makarov + + PR target/79131 + * lra-assigns.c (find_hard_regno_for_1): Take endianess for into + account to calculate conflict_set. + 2017-01-27 Bin Cheng PR rtl-optimization/78559 Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 244987) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2017-01-27 Vladimir Makarov + + PR target/79131 + * gcc.target/arm/pr79131.c: Rename to gcc.target/arm/pr79131-1.c. + * gcc.target/arm/pr79131-2.c: New. + 2017-01-27 Bill Schmidt PR target/65484 Index: lra-assigns.c =================================================================== --- lra-assigns.c (revision 244942) +++ lra-assigns.c (working copy) @@ -564,32 +564,45 @@ find_hard_regno_for_1 (int regno, int *c offset = lra_reg_info[regno].offset; CLEAR_HARD_REG_SET (impossible_start_hard_regs); EXECUTE_IF_SET_IN_SPARSESET (live_range_hard_reg_pseudos, conflict_regno) - if (lra_reg_val_equal_p (conflict_regno, val, offset)) - { - conflict_hr = live_pseudos_reg_renumber[conflict_regno]; - nregs = (hard_regno_nregs[conflict_hr] - [lra_reg_info[conflict_regno].biggest_mode]); - /* Remember about multi-register pseudos. For example, 2 hard - register pseudos can start on the same hard register but can - not start on HR and HR+1/HR-1. */ - for (hr = conflict_hr + 1; - hr < FIRST_PSEUDO_REGISTER && hr < conflict_hr + nregs; - hr++) - SET_HARD_REG_BIT (impossible_start_hard_regs, hr); - for (hr = conflict_hr - 1; - hr >= 0 && hr + hard_regno_nregs[hr][biggest_mode] > conflict_hr; - hr--) - SET_HARD_REG_BIT (impossible_start_hard_regs, hr); - } - else - { - add_to_hard_reg_set (&conflict_set, - lra_reg_info[conflict_regno].biggest_mode, - live_pseudos_reg_renumber[conflict_regno]); - if (hard_reg_set_subset_p (reg_class_contents[rclass], - conflict_set)) - return -1; - } + { + conflict_hr = live_pseudos_reg_renumber[conflict_regno]; + if (lra_reg_val_equal_p (conflict_regno, val, offset)) + { + conflict_hr = live_pseudos_reg_renumber[conflict_regno]; + nregs = (hard_regno_nregs[conflict_hr] + [lra_reg_info[conflict_regno].biggest_mode]); + /* Remember about multi-register pseudos. For example, 2 + hard register pseudos can start on the same hard register + but can not start on HR and HR+1/HR-1. */ + for (hr = conflict_hr + 1; + hr < FIRST_PSEUDO_REGISTER && hr < conflict_hr + nregs; + hr++) + SET_HARD_REG_BIT (impossible_start_hard_regs, hr); + for (hr = conflict_hr - 1; + hr >= 0 && hr + hard_regno_nregs[hr][biggest_mode] > conflict_hr; + hr--) + SET_HARD_REG_BIT (impossible_start_hard_regs, hr); + } + else + { + enum machine_mode biggest_conflict_mode + = lra_reg_info[conflict_regno].biggest_mode; + int biggest_conflict_nregs + = hard_regno_nregs[conflict_hr][biggest_conflict_mode]; + + nregs_diff = (biggest_conflict_nregs + - (hard_regno_nregs + [conflict_hr] + [PSEUDO_REGNO_MODE (conflict_regno)])); + add_to_hard_reg_set (&conflict_set, + biggest_conflict_mode, + conflict_hr + - (WORDS_BIG_ENDIAN ? nregs_diff : 0)); + if (hard_reg_set_subset_p (reg_class_contents[rclass], + conflict_set)) + return -1; + } + } EXECUTE_IF_SET_IN_SPARSESET (conflict_reload_and_inheritance_pseudos, conflict_regno) if (!lra_reg_val_equal_p (conflict_regno, val, offset)) Index: testsuite/gcc.target/arm/pr79131-2.c =================================================================== --- testsuite/gcc.target/arm/pr79131-2.c (revision 0) +++ testsuite/gcc.target/arm/pr79131-2.c (working copy) @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mbig-endian" } */ + +struct nilfs_segment_usage { + int su_flags; +} a; +enum { NILFS_SEGMENT_USAGE_ACTIVE, NILFS_SEGMENT_USAGE_DIRTY } fn1(); +int b; +void fn2(int *, long long); +void fn3() { + int c, d; + struct nilfs_segment_usage e = a; + fn1(); + c = e.su_flags & 1 << NILFS_SEGMENT_USAGE_DIRTY; + d = c; + fn2(&b, d ? -1 : 0); +} Index: testsuite/gcc.target/arm/pr79131.c =================================================================== --- testsuite/gcc.target/arm/pr79131.c (revision 244595) +++ testsuite/gcc.target/arm/pr79131.c (working copy) @@ -1,16 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -mbig-endian" } */ - -long long a; -enum { NILFS_SEGMENT_USAGE_ACTIVE, NILFS_SEGMENT_USAGE_DIRTY } b; -void nilfs_sufile_mod_counter(long long p1) { - long c = p1; - unsigned d = __builtin_bswap64(a); - a = __builtin_bswap64(d + c); -} -void nilfs_sufile_do_free() { - int e, f; - e = __builtin_bswap32(b) & 1 << NILFS_SEGMENT_USAGE_DIRTY; - f = e; - nilfs_sufile_mod_counter(f ? -1 : 0); -}