public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/35292] Missing Const Prop -- union fields
Date: Thu, 01 Jan 2009 21:49:00 -0000	[thread overview]
Message-ID: <20090101214816.7006.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35292-9436@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from pinskia at gcc dot gnu dot org  2009-01-01 21:48 -------
RTL DSE does this optimization ...

(insn 8 7 11 2 t.c:12 (set (mem/s/c:SI (reg/f:SI 60) [0 u.ii+0 S4 A32])
        (const_int 20 [0x14])) 47 {*movsi_1} (expr_list:REG_DEAD (reg/f:SI 60)
        (nil)))

(insn 11 8 14 2 t.c:12 (set (reg:SI 63 [ u.cc.c+1 ])
        (sign_extend:SI (mem/s/j:QI (plus:SI (reg/f:SI 60)
                    (const_int 1 [0x1])) [0 u.cc.c+1 S1 A8]))) 132
{extendqisi2} (expr_list:REG_DEAD (reg/f:SI 62)
        (nil)))

(insn 14 11 15 2 t.c:12 (set (reg:SI 65 [ u.cc.c ])
        (sign_extend:SI (mem/s/j:QI (reg/f:SI 60) [0 u.cc.c+0 S1 A32]))) 132
{extendqisi2} (expr_list:REG_DEAD (reg/f:SI 64)
        (nil)))

Into:

(insn 30 7 31 2 t.c:12 (set (reg:QI 66)
        (const_int 0 [0x0])) -1 (nil))

(insn 31 30 8 2 t.c:12 (set (reg:QI 67)
        (const_int 20 [0x14])) -1 (nil))

(insn 8 31 11 2 t.c:12 (set (mem/s/c:SI (reg/f:SI 60) [0 u.ii+0 S4 A32])
        (const_int 20 [0x14])) 47 {*movsi_1} (nil))

(insn 11 8 14 2 t.c:12 (set (reg:SI 63 [ u.cc.c+1 ])
        (sign_extend:SI (reg:QI 66))) 132 {extendqisi2} (nil))

(insn 14 11 15 2 t.c:12 (set (reg:SI 65 [ u.cc.c ])
        (sign_extend:SI (reg:QI 67))) 132 {extendqisi2} (expr_list:REG_DEAD
(reg/f:SI 60)
        (nil)))

And then combine simplifies it into just return 20 with the memory store still


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization
           Keywords|                            |TREE
   Last reconfirmed|2008-02-22 10:46:25         |2009-01-01 21:48:16
               date|                            |
            Version|unknown                     |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35292


  parent reply	other threads:[~2009-01-01 21:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22  6:53 [Bug middle-end/35292] New: " xinliangli at gmail dot com
2008-02-22 10:47 ` [Bug middle-end/35292] " rguenth at gcc dot gnu dot org
2008-02-23  5:50 ` pinskia at gcc dot gnu dot org
2008-02-24 21:15 ` rguenther at suse dot de
2009-01-01 21:49 ` pinskia at gcc dot gnu dot org [this message]
2009-05-23  9:23 ` [Bug tree-optimization/35292] " rguenth at gcc dot gnu dot org
     [not found] <bug-35292-4@http.gcc.gnu.org/bugzilla/>
2012-07-05 14:05 ` rguenth 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=20090101214816.7006.qmail@sourceware.org \
    --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).