This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21173] [4.0/4.1 regression] miscompiled pointer subtraction broke Linux kernel
- From: "stevenb at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Apr 2005 09:23:49 -0000
- Subject: [Bug tree-optimization/21173] [4.0/4.1 regression] miscompiled pointer subtraction broke Linux kernel
- References: <20050423092333.21173.mikpe@csd.uu.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From stevenb at suse dot de 2005-04-24 09:23 -------
Subject: Re: [4.0/4.1 regression] miscompiled pointer subtraction broke Linux kernel
On Sunday 24 April 2005 05:36, dberlin at dberlin dot org wrote:
> Uh, because it causes things to become non-invariant when they were
> originally invariant (because it will *always* create a new name for
> them).
Well, the comment before force_gimple_operand says it should not:
/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true,
force the result to be either ssa_name or an invariant, otherwise
just force it to be a rhs expression. If VAR is not NULL, make the
base variable of the final destination be VAR if suitable. */
tree
force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
{
tree-ssa-pre uses force_gimple_operand with SIMPLE==false, so if
expr is already a valid rhs, force_gimple_operand should do nothing.
If it does, I consider that to be a bug.
Your patch to use unshare_expr is IMHO unnecessarily expensive.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21173