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/58956] [4.7/4.8/4.9 Regression] wrong code at -O1 and above (affecting gcc 4.6 to trunk)
Date: Tue, 19 Nov 2013 11:09:00 -0000	[thread overview]
Message-ID: <bug-58956-4-4aYjkPdACM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58956-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, on GIMPLE all is ok

  <bb 2>:
  i_2 = c;
  *i_2 = foo ();

but we expand it like

;; *i_2 = foo ();   --- note, TER applies!

(insn 5 4 6 (set (reg:QI 0 ax)
        (const_int 0 [0])) t.i:26 -1
     (nil))

(call_insn 6 5 7 (set (reg:SI 0 ax)
        (call (mem:QI (symbol_ref:DI ("foo") [flags 0x3]  <function_decl
0x7f2ae1c46200 foo>) [0 foo S1 A8])
            (const_int 0 [0]))) t.i:26 -1
     (expr_list:REG_EH_REGION (const_int 0 [0])
        (nil))
    (expr_list:REG_DEP_TRUE (use (reg:QI 0 ax))
        (nil)))

(insn 7 6 8 (set (reg:SI 90)
        (reg:SI 0 ax)) t.i:26 -1
     (nil))

(insn 8 7 9 (set (reg:SI 91)
        (reg:SI 90)) t.i:26 -1

(insn 9 8 10 (set (reg/f:DI 92)
        (mem/f/c:DI (symbol_ref:DI ("c") [flags 0x2]  <var_decl 0x7f2ae1c48260
c>) [0 c+0 S8 A64])) t.i:26 -1
     (nil))

(insn 10 9 0 (set (mem:SI (reg/f:DI 92) [0 *i_2+0 S4 A32])
        (reg:SI 91)) t.i:26 -1
     (nil))

So indeed expand sees wrong IL - *c = foo () here.  I have a patch.


  parent reply	other threads:[~2013-11-19 11:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01  5:14 [Bug tree-optimization/58956] New: " su at cs dot ucdavis.edu
2013-11-01  8:34 ` [Bug tree-optimization/58956] [4.7/4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
2013-11-04 14:37 ` rguenth at gcc dot gnu.org
2013-11-09 21:56 ` mikpelinux at gmail dot com
2013-11-19 10:44 ` [Bug middle-end/58956] " rguenth at gcc dot gnu.org
2013-11-19 11:09 ` rguenth at gcc dot gnu.org [this message]
2013-11-19 13:28 ` rguenth at gcc dot gnu.org
2013-11-19 13:29 ` [Bug middle-end/58956] [4.7/4.8 " rguenth at gcc dot gnu.org
2013-12-05 13:10 ` rguenth at gcc dot gnu.org
2013-12-16  8:09 ` [Bug middle-end/58956] [4.7 " jakub at gcc dot gnu.org
2014-01-07 16:49 ` jakub at gcc dot gnu.org
2014-01-08 10:14 ` hp at gcc dot gnu.org
2014-01-08 10:22 ` rguenth at gcc dot gnu.org
2014-06-12 13:31 ` 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=bug-58956-4-4aYjkPdACM@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).