public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: "Roger Sayle" <roger@nextmovesoftware.com>
Cc: "'Andreas Schwab'" <schwab@linux-m68k.org>,  <gcc-patches@gcc.gnu.org>
Subject: Re: [PING] PR middle-end/95126: Expand small const structs as immediate constants
Date: Mon, 06 Jun 2022 17:52:29 +0200	[thread overview]
Message-ID: <ydd8rq9zt4y.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <056b01d879a1$1fdccfd0$5f966f70$@nextmovesoftware.com> (Roger Sayle's message of "Mon, 6 Jun 2022 13:29:50 +0100")

Hi Roger,

>> I just tried this on i386-pc-solaris2.11: unfortunately, it made no
> difference.
>
> Awesome!  Very many thanks for trying this.  Alas it confirms that the patch
> I'm currently spinning won't have any affect.  So by a process of
> elimination,
> the miscompilation must be triggered by one of the other two changes:
>
> diff --git a/gcc/expr.cc b/gcc/expr.cc
> index fb062dc..37f1405 100644
> --- a/gcc/expr.cc
> +++ b/gcc/expr.cc
> @@ -4871,7 +4871,7 @@ emit_push_insn (rtx x, machine_mode mode, tree type,
> rtx s
>           /* If source is a constant VAR_DECL with a simple constructor,
>               store the constructor to the stack instead of moving it.  */
>           const_tree decl;
> -         if (partial == 0
> +         if (0 && partial == 0
>               && MEM_P (xinner)
>               && SYMBOL_REF_P (XEXP (xinner, 0))
>               && (decl = SYMBOL_REF_DECL (XEXP (xinner, 0))) != NULL_TREE
> @@ -10603,7 +10603,7 @@ expand_expr_real_1 (tree exp, rtx target,
> machine_mode t
>         }
>        /* Expand const VAR_DECLs with CONSTRUCTOR initializers that
>          have scalar integer modes to a reg via store_constructor.  */
> -      if (TREE_READONLY (exp)
> +      if (0 && TREE_READONLY (exp)
>           && !TREE_SIDE_EFFECTS (exp)
>           && (modifier == EXPAND_NORMAL || modifier == EXPAND_STACK_PARM)
>           && immediate_const_ctor_p (DECL_INITIAL (exp))

I've tried both chunks individually: the second one allowed the build to
finish successfully.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

      reply	other threads:[~2022-06-06 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 10:49 Roger Sayle
2022-06-05 17:53 ` Andreas Schwab
2022-06-05 20:31   ` Rainer Orth
2022-06-06  8:43     ` Roger Sayle
2022-06-06 11:16       ` Andreas Schwab
2022-06-06 11:23         ` Roger Sayle
2022-06-06 11:44           ` Andreas Schwab
2022-06-06 12:01         ` Rainer Orth
2022-06-06 12:00       ` Rainer Orth
2022-06-06 12:29         ` Roger Sayle
2022-06-06 15:52           ` Rainer Orth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydd8rq9zt4y.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=roger@nextmovesoftware.com \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).