public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dnovillo at redhat dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug optimization/11373] [tree-ssa] asm generated lhs expressions are discarded Date: Fri, 25 Jul 2003 23:51:00 -0000 [thread overview] Message-ID: <20030725235124.28820.qmail@sources.redhat.com> (raw) In-Reply-To: <20030629143256.11373.marcus@jet.franken.de> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11373 ------- Additional Comments From dnovillo at redhat dot com 2003-07-25 23:51 ------- Subject: Re: [tree-ssa] asm generated lhs expressions are discarded This patch should fix the problem. I will commit it in my next round of patches. Diego. PR optimization/11373 * tree-ssa-dce.c (stmt_useful_p): Scan operands before checking for volatile operands. * tree-dfa.c (get_expr_operands): If a nonzero constant is used in an INDIRECT_REF expression, mark the statement as having volatile operands. (may_access_global_mem_p): Return true if the pointer is a nonzero constant. Index: tree-ssa-dce.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dce.c,v retrieving revision 1.1.2.47 diff -d -u -p -r1.1.2.47 tree-ssa-dce.c --- tree-ssa-dce.c 22 Jul 2003 02:50:15 -0000 1.1.2.47 +++ tree-ssa-dce.c 25 Jul 2003 23:48:44 -0000 @@ -283,12 +283,12 @@ stmt_useful_p (tree stmt) return true; } + /* Examine all the stores in this statement. */ + get_stmt_operands (stmt); + /* If the statement has volatile operands, it needs to be preserved. */ if (stmt_ann (stmt)->has_volatile_ops) return true; - - /* Examine all the stores in this statement. */ - get_stmt_operands (stmt); ops = def_ops (stmt); for (i = 0; ops && i < VARRAY_ACTIVE_SIZE (ops); i++) Index: tree-dfa.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v retrieving revision 1.1.4.135 diff -d -u -p -r1.1.4.135 tree-dfa.c --- tree-dfa.c 25 Jul 2003 03:13:07 -0000 1.1.4.135 +++ tree-dfa.c 25 Jul 2003 23:48:44 -0000 @@ -377,6 +377,15 @@ get_expr_operands (tree stmt, tree *expr add_stmt_operand (&TREE_OPERAND (ptr, 0), stmt, flags, prev_vops); return; } + else if (TREE_CONSTANT (ptr) && !integer_zerop (ptr)) + { + /* If a constant is used as a pointer, we can't generate a real + operand for it but we mark the statement volatile to prevent + optimizations from messing things up. */ + stmt_ann (stmt)->has_volatile_ops = true; + return; + } + /* Add a USE operand for the base pointer. */ get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_none, prev_vops); @@ -2103,6 +2112,10 @@ may_access_global_mem_p (tree expr) /* Call expressions that return pointers may point to global memory. */ if (TREE_CODE (expr) == CALL_EXPR) + return true; + + /* A non-NULL constant used as a pointer points to global memory. */ + if (TREE_CONSTANT (expr) && !integer_zerop (expr)) return true; /* Recursively check the expression's operands. */
next prev parent reply other threads:[~2003-07-25 23:51 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-06-29 14:32 [Bug c/11373] New: " marcus at jet dot franken dot de 2003-06-29 14:33 ` [Bug c/11373] " marcus at jet dot franken dot de 2003-06-29 14:49 ` [Bug optimization/11373] " pinskia at physics dot uc dot edu 2003-06-29 14:51 ` pinskia at physics dot uc dot edu 2003-06-29 14:55 ` marcus at jet dot franken dot de 2003-07-05 15:59 ` [Bug optimization/11373] [tree-ssa] " pinskia at physics dot uc dot edu 2003-07-15 1:56 ` pinskia at physics dot uc dot edu 2003-07-15 2:04 ` dnovillo at redhat dot com 2003-07-15 2:04 ` dnovillo at gcc dot gnu dot org 2003-07-15 5:50 ` marcus at jet dot franken dot de 2003-07-15 12:19 ` dnovillo at redhat dot com 2003-07-16 20:17 ` marcus at jet dot franken dot de 2003-07-17 13:54 ` pinskia at physics dot uc dot edu 2003-07-25 23:51 ` dnovillo at redhat dot com [this message] 2003-07-31 16:33 ` cvs-commit at gcc dot gnu dot org 2003-08-03 19:29 ` pinskia at physics dot uc dot edu
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=20030725235124.28820.qmail@sources.redhat.com \ --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: linkBe 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).