From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66601 invoked by alias); 5 Jan 2017 16:20:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 66592 invoked by uid 89); 5 Jan 2017 16:20:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=reloading, wishes, cope X-HELO: mail-wm0-f42.google.com Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jan 2017 16:20:04 +0000 Received: by mail-wm0-f42.google.com with SMTP id t79so489907329wmt.0 for ; Thu, 05 Jan 2017 08:20:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=NcT//mlXzurIdga9tMYWqMMzRy1CcrT0BfttS5t3U5Y=; b=Q8fesviEPNmgjXKc8wNnw4GMVloRUsl/DHRarsM6VSd7qCOp3dhOpnXl+KdqfdQm+N vgVE+HzKmUvAvg+TzdBaCvRxQeIWlAynyZNNBh91kR7g9zIlQ+68scBg640QxwCW8pxr O4P2PPCdWbnqyNqRH43z2kiL25l83ag2a0++ZV1kxeRc5wsOzA7TJEEVShAGO9kE3N/f 8GC+OWpSMJ2B+iasTtNbRhoWv7pgZU1QIJFjbKvKEl8IQlnkKxoNgOPZ/kyW8vHRk+ZC Ec0E+0nlp9BoiFL4ZQJgOy3+cqXJRZCYNFOLrxjOj+5RVczvD6qTLm83NekxvmS5XDiH Jckg== X-Gm-Message-State: AIkVDXLkrbFd+6SXxfrcQ0GM5niXdFqob/IIo1sDvCojJyTuCDf0UjzlnjKYBxVxQ+mbOA== X-Received: by 10.28.19.67 with SMTP id 64mr61296716wmt.111.1483633202264; Thu, 05 Jan 2017 08:20:02 -0800 (PST) Received: from [10.15.38.164] ([92.103.127.250]) by smtp.gmail.com with ESMTPSA id ct7sm104467334wjc.2.2017.01.05.08.20.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 08:20:01 -0800 (PST) From: Aurelien Buhrig To: gcc@gcc.gnu.org Subject: input address reload issue Message-ID: <094e7c3d-fc6c-1b0a-29c3-263cadec25a7@gmail.com> Date: Thu, 05 Jan 2017 16:20:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2017-01/txt/msg00023.txt.bz2 Hi all, and best wishes for the happy new year! I'm porting a private 4.6 backend to GCC 6 and facing a reload issue and I would appreciate a little help to cope with it. The issue happens when reloading: (set (reg:QI 47 [ _9 ]) (mem:QI (plus:SI (reg/v/f:SI 68 [orig:51 in ] [51]) (const_int 1 [0x1]) My understanding is that IRA allocates hardregs to allocno which are replaced by the reload pass which generates new reloads or spills regs when needed, right? Here the IRA chooses a reg (named r2)which makes the mem address not legitimate. Is it valid to allocate a reg which makes non legitimate address? Assuming it is, my understanding is that the reload chooses a legitimate reg (named a0 here) and shall emit insns (in emit_reload_insns) to set a0 correctly (RELOAD_FOR_INPUT_ADDRESS). Right? So the insn: (set (reg:QI 0 r0) (mem:QI (plus:SI (reg:SI 2 r2)(const_int 1)) is transformed into: (set (reg:SI 8 a0) (reg:SI 2 r2)) (set (reg:SI 8 a0) (const_int 1)) (set (reg:SI 8 a0) (plus:SI (reg:SI 8 a0) (reg:SI 8 a0))) (set (reg:QI 0 r0) (mem:QI (reg:SI 8 a0)) This "basic" transformation requires two reload regs, but only one is given/used/possible from the rl structure (in emit_reload_insns). So where does the issue comes from? The need for 2 reload regs, the transformation which is too "basic" and could be optimized to use only one reload reg, or any wrong/missing reload target hook? Thanks in advance. Aurélien