From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 8A1363858C53 for ; Sun, 19 Mar 2023 16:48:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A1363858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1032.google.com with SMTP id l9-20020a17090a3f0900b0023d32684e7fso11728721pjc.1 for ; Sun, 19 Mar 2023 09:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679244498; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HNpgYD4dXmsO9A383YYyjWm3EIZk5nJW6VSy87pZz+Q=; b=CYlmjfEp6IaDz2oATIyu7s8gD7jcixn9nf2WPorOEZQBn96qm8E8FAghZXYt+SHq/V M14SYNju+3J3LHJO9Bxr6EpdIJmY7dZ/gihc1NgspYY6EXFQypqR7m1XfxIdyHJ8hf/Y 5rghvKdSsOiKiNhhbDtWoG7NPQ3dq3L1ioTkACCJV0iIraJOSFP6RcnSqy62Pf/8YR5W jA1gP48nsRjsMOSdFGU115oZ3uMHaui0C1T6HfZeBNc4VPm1DNEtykePRGhfr2atP7f4 zl4zU8YMpWwyVLX3XxYEIGx11AikMPojbmcW+dQ4XjWuamzzDUtnj+AZyrLZa+NeApMV gI8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679244498; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HNpgYD4dXmsO9A383YYyjWm3EIZk5nJW6VSy87pZz+Q=; b=POxZ3w/6kKyjZFJYNDLj1aZRUW+RRIX+lCyDfSlWRtix+jYUTLj3xvWNdwewWLW08W cXhzt37cHi7ATKkPKysMeK7Hw/wMCpNCaX1zwN7TYI0Y6+MbgqXSsP0XyOYiN4L2dCYH Fmt+5XwbcP6zd/alPgIJJOzMWVy9O50plSl9Fs0bQjqYmr6tumq0KphhoBox1OAsdpbq iuX6hJglU8+19rs9kt3Trf44hKIpt3pqPcc/vJ0vmBGNNZ1fJea3uDR9ho8KwGykZmFK lMgKRfEWhHrwUfgbGgSb6bnhXUQT7T98TwPQp/aF8W9i1FcaDz2V9CP5/AZG8I2oxQos 3ptA== X-Gm-Message-State: AO0yUKW1rJ/ZIEAejutKgIyLK0e70pNT+YmY01mQ7huEigz6fhCqs5VX xTFzEUJqm40nJeDElhBfv7A= X-Google-Smtp-Source: AK7set89Yt/f0U8qYuGLV2bX6w3LlLw0V8Z4/ilpSQa2hVwyrzYrVDhyCiCPZ470gGZGvqqfdtHydA== X-Received: by 2002:a17:902:c411:b0:19a:9859:be26 with SMTP id k17-20020a170902c41100b0019a9859be26mr13639608plk.22.1679244498355; Sun, 19 Mar 2023 09:48:18 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id e20-20020a170902ed9400b001a1c69cc0c7sm1401551plj.194.2023.03.19.09.48.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Mar 2023 09:48:17 -0700 (PDT) Message-ID: <12fc0173-192d-b403-f714-52512eb6ec87@gmail.com> Date: Sun, 19 Mar 2023 10:48:16 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2] PR target/89828 Inernal compiler error on -fno-omit-frame-pointer Content-Language: en-US To: Yoshinori Sato , gcc-patches@gcc.gnu.org References: <7e49f36f-73d6-bf9b-fe83-b36474e09ae2@gmail.com> <20230315075103.1039307-1-ysato@users.sourceforge.jp> From: Jeff Law In-Reply-To: <20230315075103.1039307-1-ysato@users.sourceforge.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/15/23 01:51, Yoshinori Sato wrote: > What about this? > It no longer occurs for me. > > gcc/config/rx/ > * rx.cc (add_pop_cfi_notes): Release the frame pointer if it is used. > (rx_expand_prologue): Redesigned stack pointer and frame pointer update process. So I think the ChangeLog entry needs a bit of work. I don't see how the ChangeLog entry for add_pop_cfi_notes relates to the changes at all. This might be better: * config/rx/rx.cc (add_pop_cfi_notes): Attach CFA_RESTORE notes first, then the CFA_ADJUST_CFA note. If restoring the frame pointer, use (fp + offset) for the CFA_ADJUST_CFA note. > @@ -1815,37 +1819,17 @@ rx_expand_prologue (void) > } > } > > - /* If needed, set up the frame pointer. */ > - if (frame_pointer_needed) > - gen_safe_add (frame_pointer_rtx, stack_pointer_rtx, > - GEN_INT (- (HOST_WIDE_INT) frame_size), true); > - > - /* Allocate space for the outgoing args. > - If the stack frame has not already been set up then handle this as well. */ > - if (stack_size) > + if (stack_size || frame_size) > { > - if (frame_size) > - { > - if (frame_pointer_needed) > - gen_safe_add (stack_pointer_rtx, frame_pointer_rtx, > - GEN_INT (- (HOST_WIDE_INT) stack_size), true); > - else > - gen_safe_add (stack_pointer_rtx, stack_pointer_rtx, > - GEN_INT (- (HOST_WIDE_INT) (frame_size + stack_size)), > - true); > - } > - else > - gen_safe_add (stack_pointer_rtx, stack_pointer_rtx, > - GEN_INT (- (HOST_WIDE_INT) stack_size), true); > + gen_safe_add (stack_pointer_rtx, stack_pointer_rtx, > + GEN_INT (- (HOST_WIDE_INT) (stack_size + frame_size)), > + true); > } > - else if (frame_size) > + if (frame_pointer_needed) > { > - if (! frame_pointer_needed) > - gen_safe_add (stack_pointer_rtx, stack_pointer_rtx, > - GEN_INT (- (HOST_WIDE_INT) frame_size), true); > - else > - gen_safe_add (stack_pointer_rtx, frame_pointer_rtx, NULL_RTX, > - false /* False because the epilogue will use the FP not the SP. */); > + gen_safe_add (frame_pointer_rtx, stack_pointer_rtx, > + GEN_INT ((HOST_WIDE_INT) stack_size), > + true); It looks like we're emitting; (set (sp) (plus (sp) (stack_size + frame_size) Then we emit (set (fp) (plus (sp) (stack_size)) Unless I missing something important, that seems wrong and results in stack_size being added to FP twice. jeff