This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Anybody have any idea about why local_decls would go missing?
- From: Gary Oblock <goblock at marvell dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 10 Jan 2020 00:54:50 +0000
- Subject: Anybody have any idea about why local_decls would go missing?
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mtzoSTboV8OBJC42s6R8vy7Zq14yFYAqBIJN+cZu3/M=; b=Mmtm9xwaY+Fbe3Vx6zDfk03vdLB079xEvPc5jN6eSSssxBELpNJzn+pER6tVUYT53SkKrP9Nt3mV1hRcO7JhEADkuNS0swjaVyrcoYgSMXhJYF2GtHIfDNVBikgSHxTmWDxjSZjM5T7xEgXmO70FQVkzQMKoLlqhv0mEyLNa4w+jymJElhGBYeBM93GWmTcfUrle4FTWmWZTF48auuWYSGPcL0U2Yu60mUCf427M1DDKPW9f3GjloPfO3UrM7XGCu8vvBNUEb1SZInVBLf8dyQJPHZeHNDXh2WJ+Wjias8Opp0GrNHQKIl0wbbJv2/Z6fguQQW9+FF7U20MtPm9bJw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O6Rp7gruNORrm+fvY+9PGUpvbCTdhrxQKlNU6HH9yMwFllDTy2DllnD0IFLmFTM8s+9ltJ08Flq1LfseeJXv6DYZ1RglcAYYjqhn0Bd6JyGDECJRKBhOkhMyB172+OvGCwpVto9B9o9PQy+cEbHZlEwjvecGMnkKTxpl1THTvmJy+YIJC9VYwcRmds5QUrCNi3LRJv3E+m2NVmwv3jbxhIItwea3Ayfdub9iBQubqLrYYVEc9PkDhN5Q0J5cZODnVT3iPIUcpJhpY4FLnGxqi4pdGWdOk8c+no1IN7IFyPmLSm54zHPiY4et4rjrjzIuwXFc/Z8hsvONjbSmICdbJg==
This is at LTO time and the function in question is this:
#include "stdlib.h"
typedef struct bogus type_ta;
struct bogus {
int i;
double x;
int j;
};
void
helper( void *x)
{
type_ta *y = (type_ta*)x;
y->i = rand();
}
and I'm checking the local_decls it like this:
cgraph_node* node;
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY ( node)
{
tree decl;
unsigned i;
node->get_untransformed_body ();
struct function *fn = DECL_STRUCT_FUNCTION ( node->decl);
DEBUG( "L# %d, fuction name = %s\n", __LINE__, lang_hooks.decl_printable_name ( node->decl, 2));
if( fn == NULL )
{
DEBUG( " EMPTY\n");
continue;
}
FOR_EACH_LOCAL_DECL ( fn, i, decl)
{
tree base = base_type_of ( decl);
DEBUG( "L# %d Consider local var decl\n", __LINE__);
.
.
Needless to sat I get the function name "helper" but no variables.
I suspected the LTO streaming process but that seems bullet proof
and if local_decls are there when streaming out it should be restored when
streaming in. I also suspected inlining but it still happened with
"-fno-inline" present.
If you'll note the get_untransformed_body call above (which David Malcolm
suggested to cure a NULL fn) I suspect I'm lacking some other call
which will make all things right.
Thanks,
Gary Oblock