public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gaelan Steele <gbs3@st-andrews.ac.uk>
To: David Brown <david@westcontrol.com>,
	Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Why does this unrolled function write to the stack?
Date: Wed, 8 Feb 2023 18:52:58 +0000	[thread overview]
Message-ID: <VE1PR06MB705480C397197BE7CA931012F1D89@VE1PR06MB7054.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <69488f61-fac0-0c1d-1034-d8d84779f8e2@westcontrol.com>

Thanks for the help investigating, both of you!

> It seems to be a regression between gcc 10 and gcc 11 (discovered by
> changing the compiler on godbolt.org).  With gcc 11 onwards, the
> compiler seems to be using the stack to combine two 4-byte elements at a
> time into a single 8-byte element.  It's easy to see the effect by
> changing the loop size to 2.

I gave this a bisect, and it looks like the commit that caused it is this one:

commit 33c0f246f799b7403171e97f31276a8feddd05c9
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Oct 30 11:26:18 2020 +0100

    tree-optimization/97626 - handle SCCs properly in SLP stmt analysis

The details of how this ties back to the behavior we're seeing go far
above my head, unfortunately.

I'll go ahead and file a bug on the tracker.

Thanks again,
Gaelan
PS Apologies for the horrendous wrapping in my previous email! I'm
using webmail because my normal machine is in repair, and list etiquette
totally slipped my mind.

      reply	other threads:[~2023-02-08 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 13:29 Gaelan Steele
2023-02-08 13:49 ` Jonathan Wakely
2023-02-08 13:53   ` Jonathan Wakely
2023-02-08 15:32     ` David Brown
2023-02-08 18:52       ` Gaelan Steele [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=VE1PR06MB705480C397197BE7CA931012F1D89@VE1PR06MB7054.eurprd06.prod.outlook.com \
    --to=gbs3@st-andrews.ac.uk \
    --cc=david@westcontrol.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    /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).