From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27513 invoked by alias); 10 Feb 2015 20:48:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27408 invoked by uid 55); 10 Feb 2015 20:48:05 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64974] [SH] Weird expansion of 'expected' operand in atomic_compare_and_swap Date: Tue, 10 Feb 2015 20:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg01086.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64974 --- Comment #1 from Oleg Endo --- Author: olegendo Date: Tue Feb 10 20:47:33 2015 New Revision: 220594 URL: https://gcc.gnu.org/viewcvs?rev=220594&root=gcc&view=rev Log: gcc/ PR target/64661 * config/sh/sh-protos.h (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_IMASK): Add parentheses. * config/sh/constraints.md (Ara, Add): New constraints. * config/sh/sync.md (atomic_mem_operand_0, atomic_mem_operand_1): New predicates. (atomic_compare_and_swap, atomic_exchange): Use atomic_mem_operand_0. Don't use force_reg on the memory address. (atomic_compare_and_swapsi_hard): Use atomic_mem_operand_0 predicate and Sra constraint. Convert to insn_and_split. Add workaround for PR 64974. (atomic_compare_and_swap_hard): Copy to atomic_compare_and_swap_hard_1. Convert to insn_and_split. Use atomic_mem_operand_0 predicate. (atomic_compare_and_swap_soft_gusa, atomic_exchange_soft_gusa): Use atomic_mem_operand_0 predicate and AraAdd constraints. (atomic_compare_and_swap_soft_tcb, atomic_compare_and_swap_soft_imask, atomic_exchange_soft_tcb, atomic_exchange_soft_imask): Use atomic_mem_operand_0 predicate and SraSdd constraints. (atomic_exchangesi_hard) Use atomic_mem_operand_0 predicate and Sra constraint. (atomic_exchange_hard): Copy to atomic_exchange_hard_1. Convert to insn_and_split. Use atomic_mem_operand_0 predicate. (atomic_fetch_, atomic_fetch_nand, atomic__fetch): Use atomic_mem_operand_1. Don't use force_reg on the memory address. (atomic_fetch_si_hard, atomic_fetch_notsi_hard, atomic_fetch_nandsi_hard, atomic__fetchsi_hard, atomic_not_fetchsi_hard, atomic_nand_fetchsi_hard): Use atomic_mem_operand_1 predicate and Sra constraint. (atomic_fetch__hard): Copy to atomic_fetch__hard_1. Convert to insn_and_split. Use atomic_mem_operand_1 predicate. (atomic__hard): Copy to atomic__hard_1. Convert to insn_and_split. Use atomic_mem_operand_1 predicate. (atomic_fetch_nand_hard): Copy to atomic_fetch_nand_hard_1. Convert to insn_and_split. Use atomic_mem_operand_1 predicate. (atomic_nand_hard): Copy to atomic_nand_hard_1. Convert to insn_and_split. Use atomic_mem_operand_1 predicate. (atomic__fetch_hard): Copy to atomic__fetch_hard_1. Convert to insn_and_split. Use atomic_mem_operand_1 predicate. (atomic_nand_fetch_hard): Copy to atomic_nand_fetch_hard_1. Convert to insn_and_split. Use atomic_mem_operand_1 predicate. (atomic_fetch_not_hard, atomic_not_fetch_hard): Replace mems in generated insn with original mem operand before emitting the insn. (atomic_fetch__soft_gusa, atomic_fetch_not_soft_gusa, atomic_fetch_nand_soft_gusa, atomic__fetch_soft_gusa, atomic_not_fetch_soft_gusa, atomic_nand_fetch_soft_gusa): Use atomic_mem_operand_1 predicate and AraAdd constraints. (atomic_fetch__soft_tcb, atomic__soft_tcb, atomic_fetch_not_soft_tcb, atomic_not_soft_tcb, atomic_fetch__soft_imask, atomic_fetch_not_soft_imask, atomic_fetch_nand_soft_tcb, atomic_nand_soft_tcb, atomic_fetch_nand_soft_imask, atomic__fetch_soft_tcb, atomic_not_fetch_soft_tcb, atomic__fetch_soft_imask, atomic_not_fetch_soft_imask, atomic_nand_fetch, atomic_nand_fetch_soft_tcb, atomic_nand_fetch_soft_imask): Use atomic_mem_operand_1 predicate and SraSdd constraints. gcc/testsuite/ PR target/64661 * gcc.taget/sh/pr64661-0.h: New. * gcc.taget/sh/pr64661-1.c: New. * gcc.taget/sh/pr64661-2.c: New. * gcc.taget/sh/pr64661-3.c: New. * gcc.taget/sh/pr64661-4.c: New. Added: trunk/gcc/testsuite/gcc.target/sh/pr64661-0.h trunk/gcc/testsuite/gcc.target/sh/pr64661-1.c trunk/gcc/testsuite/gcc.target/sh/pr64661-2.c trunk/gcc/testsuite/gcc.target/sh/pr64661-3.c trunk/gcc/testsuite/gcc.target/sh/pr64661-4.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/sh/constraints.md trunk/gcc/config/sh/sh-protos.h trunk/gcc/config/sh/sync.md trunk/gcc/testsuite/ChangeLog