public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58805] [4.8/4.9 Regression] Inline assembly wrongly optimized out when inside a conditional
Date: Mon, 21 Oct 2013 10:14:00 -0000	[thread overview]
Message-ID: <bug-58805-4-clq3PTXHDu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58805-4@http.gcc.gnu.org/bugzilla/>

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

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #11 from vries at gcc dot gnu.org ---
Using this tentative patch, tree-tail-merge leaves the test-case alone:
...
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 3ddceb9..7e00037 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2394,6 +2394,13 @@ gimple_copy (gimple stmt)
   return copy;
 }

+static bool
+return_true_bool_gimple_tree_voidptr (gimple s ATTRIBUTE_UNUSED,
+                                     tree t ATTRIBUTE_UNUSED,
+                                     void *p ATTRIBUTE_UNUSED)
+{
+  return true;
+}

 /* Return true if statement S has side-effects.  We consider a
    statement to have side effects if:
@@ -2413,9 +2420,16 @@ gimple_has_side_effects (const_gimple s)
   if (gimple_has_volatile_ops (s))
     return true;

-  if (gimple_code (s) == GIMPLE_ASM
-      && gimple_asm_volatile_p (s))
-    return true;
+  if (gimple_code (s) == GIMPLE_ASM)
+    {
+      if (gimple_asm_volatile_p (s))
+       return true;
+
+      if (walk_stmt_load_store_addr_ops ((gimple)s, NULL, NULL,
+                                        return_true_bool_gimple_tree_voidptr,
+                                        NULL))
+      return true;
+    }

   if (is_gimple_call (s))
     {
...


  parent reply	other threads:[~2013-10-21 10:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-19 11:01 [Bug inline-asm/58805] New: " Jeremie.Detrey at loria dot fr
2013-10-19 11:52 ` [Bug inline-asm/58805] " mikpelinux at gmail dot com
2013-10-19 18:02 ` [Bug inline-asm/58805] [4.8/4.9 Regression] " pinskia at gcc dot gnu.org
2013-10-19 19:15 ` mikpelinux at gmail dot com
2013-10-19 22:08 ` segher at gcc dot gnu.org
2013-10-19 22:39 ` pinskia at gcc dot gnu.org
2013-10-19 22:40 ` pinskia at gcc dot gnu.org
2013-10-19 22:59 ` segher at gcc dot gnu.org
2013-10-19 23:07 ` segher at gcc dot gnu.org
2013-10-21  9:11 ` [Bug tree-optimization/58805] " vries at gcc dot gnu.org
2013-10-21 10:14 ` vries at gcc dot gnu.org [this message]
2013-10-21 10:16 ` rguenth at gcc dot gnu.org
2013-10-21 12:24 ` vries at gcc dot gnu.org
2013-10-21 12:41 ` rguenth at gcc dot gnu.org
2013-10-21 14:43 ` vries at gcc dot gnu.org
2013-10-23 13:26 ` vries at gcc dot gnu.org
2013-10-23 19:17 ` vries at gcc dot gnu.org
2013-10-24  8:47 ` vries 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-58805-4-clq3PTXHDu@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).