------- Comment #22 from wilson at specifix dot com 2007-09-12 23:35 -------
Subject: Re: [4.3 Regression] Revision 128239
causes libgomp failure
jakub at gcc dot gnu dot org wrote:
> No matter whether it is right or wrong in tree-ssa-operands.c, I think
> sdse should just avoid removing VAR_DECL DECL_HARD_REGISTER store elimination.
This isn't a volatile register, nor a global register variable, so there
should be no problem performing dead store elimination on it. I think
tree-ssa-operands.c needs to be fixed.
I'm not a tree-ssa expert, but the fix needed in tree-ssa-operands.c
seems simple enough. The append_vuse function does two things, it keeps
a list of v_uses, and it keeps a list of loads. We don't want a v_use
if we already have a v_def, but we still need to mark it as a load. We
can do that with a little rearrangement of the code. Like this.
This works for the testcase, but has had no other testing as yet.
2007-09-12 James E. Wilson <[EMAIL PROTECTED]>
* tree-ssa-operands.c (append_vuse): If ann->in_vdef_list true,
then set build_loads before returning.
Index: tree-ssa-operands.c
===================================================================
--- tree-ssa-operands.c (revision 128394)
+++ tree-ssa-operands.c (working copy)
@@ -1164,8 +1164,15 @@
/* Don't allow duplicate entries. */
ann = get_var_ann (var);
- if (ann->in_vuse_list || ann->in_vdef_list)
+ if (ann->in_vuse_list)
return;
+ else if (ann->in_vdef_list)
+ {
+ /* We don't want a vuse if we already have a vdef, but we must
+ still put this in build_loads. */
+ bitmap_set_bit (build_loads, DECL_UID (var));
+ return;
+ }
ann->in_vuse_list = true;
sym = var;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33389