public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/107389] Always propagate __builtin_assume_aligned
Date: Fri, 28 Oct 2022 09:30:46 +0000	[thread overview]
Message-ID: <bug-107389-4-23NMNbsSZK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107389-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107389

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 53784
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53784&action=edit
prototype

This implements an -O0 fold-builtins pass.  I've disabled some but not all
"optimizations" and instead of just throwing away __builtin_assume_aligned
I'm processing it at -O0 (the machinery from CCP relies on a lattice, with
optimization we should at least merge with the alignment info on the LHS).

On s390 I then see

foo:
.LFB0:
        .cfi_startproc
        stmg    %r11,%r15,88(%r15)
        .cfi_offset 11, -72
        .cfi_offset 12, -64
        .cfi_offset 13, -56
        .cfi_offset 14, -48
        .cfi_offset 15, -40
        aghi    %r15,-176
        .cfi_def_cfa_offset 336
        lgr     %r11,%r15
        .cfi_def_cfa_register 11
        stg     %r2,168(%r11)
        stg     %r3,160(%r11)
        lg      %r1,160(%r11)
        lpq     %r2,0(%r1)
        lg      %r1,168(%r11)
        stmg    %r2,%r3,0(%r1)
        lg      %r2,168(%r11)
        lmg     %r11,%r15,264(%r11)
        .cfi_restore 15
        .cfi_restore 14
        .cfi_restore 13
        .cfi_restore 12
        .cfi_restore 11
        .cfi_def_cfa 15, 160
        br      %r14
        .cfi_endproc

specifically I did not disable __atomic_add_fetch_* optimizations to
.ATOMIC_ADD_FETCH_CMP_0 and friends and also kept optimizing
stack_save/restore.

  parent reply	other threads:[~2022-10-28  9:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  7:57 [Bug c/107389] New: Alignment not inferred from type at -O0 rth at gcc dot gnu.org
2022-10-25 12:46 ` [Bug c/107389] " rguenth at gcc dot gnu.org
2022-10-25 12:52 ` rguenth at gcc dot gnu.org
2022-10-25 15:12 ` rth at gcc dot gnu.org
2022-10-26  8:15 ` [Bug middle-end/107389] Always propagate __builtin_assume_aligned rth at gcc dot gnu.org
2022-10-28  9:19 ` rguenth at gcc dot gnu.org
2022-10-28  9:30 ` rguenth at gcc dot gnu.org [this message]
2022-11-08 15:39 ` cvs-commit at gcc dot gnu.org
2022-11-08 15:40 ` rguenth at gcc dot gnu.org
2022-11-28 22:15 ` pinskia at gcc dot gnu.org

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=bug-107389-4-23NMNbsSZK@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).