[tree-ssa] live analysis on local static functions
Andrew MacLeod
amacleod@redhat.com
Tue Oct 14 19:15:00 GMT 2003
On Tue, 2003-10-14 at 13:34, law@redhat.com wrote:
> In message <1066151692.19104.2006.camel@p4>, Andrew MacLeod writes:
> >On Tue, 2003-10-14 at 13:05, Andrew MacLeod wrote:
> >> On Tue, 2003-10-14 at 13:03, law@redhat.com wrote:
> >> > In message <1066149766.10504.1982.camel@p4>, Andrew MacLeod writes:
> >>
> >> > >
> >> > >I get out of ssa producing:
> >> > >
> >> > >q ()
> >> > >{
> >> > > char * <U1244>;
> >> > > char * retval.2;
> >> > > char * T.1;
> >> > >
> >> > >
> >> > > # BLOCK 0. PRED: -1. SUCC: 1.
> >> > > {
> >> > > {
> >> > > static char * a = (char *)"";
> >> > >
> >> > >
> >> > > # VUSE <a_1>;
> >> > > <U1244> = a;
> >> > > goto <U11d0>;;
> >> > > };
> >> > >
> >> > > # BLOCK 1. PRED: 0. SUCC: 2.
> >> > > <U11d0>:;;
> >> > > (void)0;
> >> > > };
> >> > >
> >> > > # BLOCK 2. PRED: 1. SUCC: -2.
> >> > > (void)0;
> >> > > return <U1244>;;
> >> > >}
> >> > >
> >>
> >> > But it still seems to me that something is missing the fact that "a"
> >> > is actually used. If "a" is marked as used, then everything ought to
> >> > work as expected.
> >>
> >> I am currently looking at why the VUSE <a_1> didnt mark 'a' as used.
> >>
> >INterestingly, the 'a' in the BIND has address
> >$7 = (union tree_node *) 0x400b12b8
> >and the 'a' used as a base for 'a_1' is:
> >$9 = (union tree_node *) 0x400adbc8
> >
> >so used is set on the one in $9, but never set on the one in $7.
> Which explains a whole lot :-)
>
> >Diego, any idea why we're using a different VAR_DECL?
> Probably an artifact of inlining I'd guess. Does either one of them
> have DECL_ABSTRACT_ORIGIN set, and if so, what tree does that point to?
>
nope. both are 0. Oh wait, yeah. the one in the BIND_EXPR does ($7). It
points to the one we are using in a_1. (the $9 value)
Andrew
(gdb) p $9->decl
$13 = {common = {chain = 0x0, type = 0x40025074, ann = 0x4001d528,
code = VAR_DECL, side_effects_flag = 0, constant_flag = 0,
addressable_flag = 0, volatile_flag = 0, readonly_flag = 0,
unsigned_flag = 1, asm_written_flag = 0, not_gimple_flag = 0,
used_flag = 1, nothrow_flag = 0, static_flag = 1, public_flag = 0,
private_flag = 0, protected_flag = 0, deprecated_flag = 0, unused_1 = 0,
lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0,
lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, visited = 0}, locus = {
file = 0x84d1ad8 "j.c", line = 4}, uid = 1002, size = 0x4001c978,
mode = SImode, external_flag = 0, nonlocal_flag = 0, regdecl_flag = 0,
inline_flag = 0, bit_field_flag = 0, virtual_flag = 0, ignored_flag = 0,
abstract_flag = 0, in_system_header_flag = 0, common_flag = 0,
defer_output = 0, transparent_union = 0, static_ctor_flag = 0,
static_dtor_flag = 0, artificial_flag = 0, weak_flag = 0,
non_addr_const_p = 0, no_instrument_function_entry_exit = 0,
comdat_flag = 0, malloc_flag = 0, no_limit_stack = 0,
built_in_class = NOT_BUILT_IN, pure_flag = 0, non_addressable = 0,
user_align = 0, uninlinable = 0, thread_local_flag = 0,
declared_inline_flag = 0, unused = 0, lang_flag_0 = 0, lang_flag_1 = 0,
lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0,
lang_flag_6 = 0, lang_flag_7 = 0, u1 = {f = BUILT_IN_COSH, i = 32, a = {
align = 32, off_align = 0}}, size_unit = 0x4001c9d8, name = 0x400b0180,
context = 0x400ad9f8, arguments = 0x0, result = 0x0, initial = 0x40059800,
abstract_origin = 0x0, assembler_name = 0x400b0300, section_name = 0x0,
attributes = 0x0, rtl = 0x0, u2 = {f = 0x0, r = 0x0, t = 0x0, i = 0},
saved_tree = 0x0, inlined_fns = 0x0, vindex = 0x0, pointer_alias_set = -1,
typevar = 0x0, lang_specific = 0x0}
(gdb) p $7->decl
$14 = {common = {chain = 0x0, type = 0x40025074, ann = 0x4001d398,
code = VAR_DECL, side_effects_flag = 0, constant_flag = 0,
addressable_flag = 0, volatile_flag = 0, readonly_flag = 0,
unsigned_flag = 1, asm_written_flag = 0, not_gimple_flag = 0,
used_flag = 1, nothrow_flag = 0, static_flag = 1, public_flag = 0,
private_flag = 0, protected_flag = 0, deprecated_flag = 0, unused_1 = 0,
lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0,
lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, visited = 0}, locus = {
file = 0x84d1ad8 "j.c", line = 4}, uid = 1008, size = 0x400b20f0,
mode = SImode, external_flag = 0, nonlocal_flag = 0, regdecl_flag = 0,
inline_flag = 0, bit_field_flag = 0, virtual_flag = 0, ignored_flag = 0,
abstract_flag = 0, in_system_header_flag = 0, common_flag = 0,
defer_output = 0, transparent_union = 0, static_ctor_flag = 0,
static_dtor_flag = 0, artificial_flag = 0, weak_flag = 0,
non_addr_const_p = 0, no_instrument_function_entry_exit = 0,
comdat_flag = 0, malloc_flag = 0, no_limit_stack = 0,
built_in_class = NOT_BUILT_IN, pure_flag = 0, non_addressable = 0,
user_align = 0, uninlinable = 0, thread_local_flag = 0,
declared_inline_flag = 0, unused = 0, lang_flag_0 = 0, lang_flag_1 = 0,
lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0,
lang_flag_6 = 0, lang_flag_7 = 0, u1 = {f = BUILT_IN_COSH, i = 32, a = {
align = 32, off_align = 0}}, size_unit = 0x400b2108, name = 0x400b0180,
context = 0x400ad9f8, arguments = 0x0, result = 0x0, initial = 0x40059ba0,
abstract_origin = 0x400adbc8, assembler_name = 0x400b0300,
section_name = 0x0, attributes = 0x0, rtl = 0x0, u2 = {f = 0x0, r = 0x0,
t = 0x0, i = 0}, saved_tree = 0x0, inlined_fns = 0x0, vindex = 0x0,
pointer_alias_set = -1, typevar = 0x0, lang_specific = 0x0}
More information about the Gcc
mailing list