public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/107115] Wrong codegen from TBAA under stores that change effective type?
Date: Sat, 01 Oct 2022 23:51:03 +0000	[thread overview]
Message-ID: <bug-107115-4-e29dVwLKMn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107115-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |middle-end

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There are two bugs I think.

One in expansion and the other in the RTL optimizers.

Without -fno-tree-ter we get:
;; MEM[(long int *)_11] = _12;

(nil)

And then we don't record the aliasing change.
This because we had got:
;; _12 = *_11;
;; MEM[(long int *)_11] = _12;


With -fno-tree-ter, we lose it during combine (on the trunk):
Trying 16 -> 17:
   16: r88:DI=[r87:DI]
   17: [r87:DI]=r88:DI
      REG_DEAD r88:DI
      REG_DEAD r87:DI
Failed to match this instruction:
(set (mem:DI (reg/f:DI 87 [ _11 ]) [1 MEM[(long int *)_11]+0 S8 A64])
    (mem:DI (reg/f:DI 87 [ _11 ]) [2 *_11+0 S8 A64]))
allowing combination of insns 16 and 17
original costs 5 + 4 = 9
replacement cost 5
deferring deletion of insn with uid = 16.
modifying insn i3    17: [r87:DI]=[r87:DI]
      REG_DEAD r87:DI
deferring rescan insn with uid = 17.


The aliasing set 1 represents `long` and 2 represents `long long` (see the
difference there).

I don't know what is the best way to represent an aliasing set change even
though the value didn't change on the RTL level.

This needed for both expand and combine (and maybe a few other places).


I should note the Gimple level was fixed for this testcase between GCC 6.2 and
GCC 6.3 so it would be interesting to find the patch which fixed that.

  parent reply	other threads:[~2022-10-01 23:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01 20:00 [Bug middle-end/107115] New: " bugdal at aerifal dot cx
2022-10-01 23:34 ` [Bug rtl-optimization/107115] " pinskia at gcc dot gnu.org
2022-10-01 23:51 ` pinskia at gcc dot gnu.org [this message]
2022-10-06  9:44 ` [Bug middle-end/107115] " rguenth at gcc dot gnu.org
2022-10-06 12:20 ` cvs-commit at gcc dot gnu.org
2022-10-06 12:24 ` rguenth at gcc dot gnu.org
2022-10-06 15:19 ` amonakov at gcc dot gnu.org
2022-10-06 15:32 ` jakub at gcc dot gnu.org
2022-10-06 15:39 ` amonakov at gcc dot gnu.org
2022-10-06 19:04 ` pinskia at gcc dot gnu.org
2022-10-07  7:41 ` rguenth at gcc dot gnu.org
2022-10-07  7:44 ` rguenth at gcc dot gnu.org
2022-10-07 13:19 ` amonakov at gcc dot gnu.org
2022-12-27 22:19 ` gabravier at gmail dot com
2022-12-27 22:21 ` gabravier at gmail dot com

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-107115-4-e29dVwLKMn@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).