This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19789] tree optimizers do not know that constant global variables do not change
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2005 18:08:46 -0000
- Subject: [Bug tree-optimization/19789] tree optimizers do not know that constant global variables do not change
- References: <20050206132148.19789.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kazu at cs dot umass dot edu 2005-02-06 18:08 -------
Yes, global_constant is considered call clobbered.
Here is the full dump of .t18.alias1.
;; Function foo (foo)
foo: Total number of aliased vops: 1
Referenced variables in foo: 5
Variable: global_constant.0, UID 0, const int
Variable: global_constant, UID 1, const int, is an alias tag, is global, call
clobbered, default def: global_constant_1
Variable: D.1128, UID 2, union node *, type memory tag: TMT.1
Variable: p, UID 3, union node *, type memory tag: TMT.1, default def: p_3
Variable: TMT.1, UID 4, union node, is addressable, is global, call clobbered,
may aliases: { global_constant }
Pointed-to sets for pointers in foo
p_3, is dereferenced, points-to anything
D.1128_4, is dereferenced, its value escapes, points-to anything
Flow-insensitive alias information for foo
Aliased symbols
global_constant, UID 1, const int, is an alias tag, is global, call clobbered,
default def: global_constant_1
TMT.1, UID 4, union node, is addressable, is global, call clobbered, may
aliases: { global_constant }
Dereferenced pointers
D.1128, UID 2, union node *, type memory tag: TMT.1
p, UID 3, union node *, type memory tag: TMT.1, default def: p_3
Type memory tags
TMT.1, UID 4, union node, is addressable, is global, call clobbered, may
aliases: { global_constant }
Flow-sensitive alias information for foo
SSA_NAME pointers
Name memory tags
foo (p)
{
union node * D.1128;
const int global_constant.0;
<bb 0>:
# VUSE <global_constant_1>;
global_constant.0_2 = global_constant;
if (global_constant.0_2 == 1) goto <L0>; else goto <L1>;
<L0>:;
# VUSE <global_constant_1>;
abort ();
<L1>:;
# VUSE <global_constant_1>;
D.1128_4 = p_3->ptr;
# global_constant_6 = V_MAY_DEF <global_constant_1>;
bar (D.1128_4);
# VUSE <global_constant_6>;
global_constant.0_5 = global_constant;
if (global_constant.0_5 == 1) goto <L2>; else goto <L3>;
<L2>:;
# VUSE <global_constant_6>;
abort ();
<L3>:;
return;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19789