public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/56442] Could not identify that register is clobbered already
Date: Mon, 25 Feb 2013 10:56:00 -0000	[thread overview]
Message-ID: <bug-56442-4-56wIn0OCyb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56442-4@http.gcc.gnu.org/bugzilla/>


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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-25
                 CC|                            |gjl at gcc dot gnu.org
          Component|target                      |other
     Ever Confirmed|0                           |1
           Severity|major                       |normal

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2013-02-25 10:56:02 UTC ---
Enabling others to understand this...

In .reload dump, we have correct code:

(insn 418 417 113 3 (set (reg:HI 24 r24)
        (const:HI (plus:HI (symbol_ref:HI ("array") [flags 0x2]  <var_decl
0x1e405a0 array>)
                (const_int 4 [0x4])))) 32 {*movhi}
     (nil))

(insn 113 418 114 3 (set (reg:HI 14 r14 [94])
        (minus:HI (reg:HI 14 r14 [94])
            (reg:HI 24 r24))) 65 {subhi3}
     (nil))

(insn 114 113 115 3 (set (reg:HI 14 r14 [94])
        (lshiftrt:HI (reg:HI 14 r14 [94])
            (const_int 2 [0x2]))) 217 {lshrhi3}
     (nil))

(insn 115 114 118 3 (parallel [
            (set (reg:HI 14 r14 [94])
                (and:HI (reg:HI 14 r14 [94])
                    (const_int 3 [0x3])))
            (clobber (reg:QI 25 r25))
        ]) 175 {andhi3}
     (nil))

(insn 118 115 119 3 (set (reg:SF 18 r18 [orig:65 D.1335 ] [65])
        (mem:SF (symbol_ref:HI ("array") [flags 0x2]  <var_decl 0x1e405a0
array>) [2 MEM[base: D.1358_18, offset: 0B]+0 S4 A8])) foo.c:15 37 {*movsf}
     (nil))

(insn 119 118 122 3 (set (reg:HI 28 r28 [orig:96 ivtmp.10 ] [96])
        (const:HI (plus:HI (symbol_ref:HI ("array") [flags 0x2]  <var_decl
0x1e405a0 array>)
                (const_int 4 [0x4])))) 32 {*movhi}
     (expr_list:REG_EQUAL (const:HI (plus:HI (symbol_ref:HI ("array") [flags
0x2]  <var_decl 0x1e405a0 array>)
                (const_int 4 [0x4])))
        (nil)))


This is changed by .postreload to:


(insn 119 118 122 3 (set (reg:HI 28 r28 [orig:96 ivtmp.10 ] [96])
        (reg:HI 24 r24)) 32 {*movhi}
     (expr_list:REG_EQUAL (const:HI (plus:HI (symbol_ref:HI ("array") [flags
0x2]  <var_decl 0x1e405a0 array>)
                (const_int 4 [0x4])))
        (nil)))


This is wrong because reg:HI 24 is (partly) clobbered by insn 115 and thus
reg:HI 24 must not be used past insn 115.

Component is not target, the target description of andhi3 insn is all right.

According to S, the bad transformation happens in:
postreload.c:reload_cse_move2add()


  parent reply	other threads:[~2013-02-25 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25  8:42 [Bug target/56442] New: " pitchumani.s at atmel dot com
2013-02-25  8:43 ` [Bug target/56442] " pitchumani.s at atmel dot com
2013-02-25 10:56 ` gjl at gcc dot gnu.org [this message]
2013-06-06 13:26 ` [Bug other/56442] " gjl at gcc dot gnu.org
2014-06-12 13:53 ` [Bug other/56442] postreload uses content of clobbered register rguenth at gcc dot gnu.org
2024-01-18  9:55 ` [Bug rtl-optimization/56442] " gjl 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-56442-4-56wIn0OCyb@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).