From: Andrew Haley <aph@redhat.com>
To: Alex Turjan <aturjan@yahoo.com>
Cc: gcc@gcc.gnu.org, rsandifor@codesourcery.com, zadeck@naturalbridge.com
Subject: Re: question about DSE
Date: Tue, 08 Sep 2009 10:25:00 -0000 [thread overview]
Message-ID: <4AA630E0.2040009@redhat.com> (raw)
In-Reply-To: <969088.51632.qm@web62405.mail.re1.yahoo.com>
Alex Turjan wrote:
> Dear all,
> Im writing to you regarding the dead store elimination (dse) which runs after register allocation. Apparently dse removes wrongly the following store (present in bb2):
>
> (insn 374 47 52 2 test.c:107 (set (mem/c:SI (plus:PSI (reg/f:PSI 55 ptr15)
> (const_int 96 [0x60])) [19 fac_iter+0 S4 A32])
> (reg/v:SI 16 r16 [orig:161 step109 ] [161])) 48 {si_indexed_store_incl_ra} (nil))
>
> despite being consumed (in bb3) by the following 2 loads:
> (insn 380 71 64 3 test.c:112 (set (reg:HI 1 r1)
> (mem:HI (plus:PSI (reg/f:PSI 55 ptr15)
> (const_int 96 [0x60])) [0 S2 A16])) 12 {load} (nil))
>
> (insn 382 346 65 3 test.c:112 (set (reg:HI 5 r5)
> (mem:HI (plus:PSI (reg/f:PSI 55 ptr15)
> (const_int 98 [0x62])) [0 S2 A16])) 12 {load} (nil))
>
>
> Can anyone point what may be the problem?
>
> As you can see the store is SI while the loads are HI. While looking to the comments from dse.c I get to the following remark:
>
> " There are three cases where dse falls short:
> a) Reload sometimes creates the slot for one mode of access, and
> then inserts loads and/or stores for a smaller mode. "
>
> Does it mean that such cases are not treated properly by dse?
>
> I observed that if I run with the flag -fno-strict-aliasing the wrongly removed store is no longer removed and the code is runs correctly.
> Im wondering does the dse after register allocation make use of type based alias analysis?
Here's part of the comment in alias.c:
/* The alias sets assigned to MEMs assist the back-end in determining
which MEMs can alias which other MEMs. In general, two MEMs in
different alias sets cannot alias each other ...
There's a lot more information in the comments there.
Andrew.
next prev parent reply other threads:[~2009-09-08 10:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-08 9:57 Alex Turjan
2009-09-08 10:25 ` Andrew Haley [this message]
2009-09-08 10:55 ` Michael Matz
2009-09-09 16:59 ` Alex Turjan
2009-09-09 17:59 ` Richard Henderson
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=4AA630E0.2040009@redhat.com \
--to=aph@redhat.com \
--cc=aturjan@yahoo.com \
--cc=gcc@gcc.gnu.org \
--cc=rsandifor@codesourcery.com \
--cc=zadeck@naturalbridge.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).