view gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-dce3" } */
  
struct rtx_def;
typedef struct rtx_def *rtx;
union tree_node;
typedef union tree_node *tree;
typedef struct mem_attrs
{
  int  foo;

} mem_attrs;
union rtunion_def
{
  mem_attrs *rtmem;
};
typedef union rtunion_def rtunion;
struct rtx_def
{
  rtunion fld[1];
};
struct tree_decl
{
  rtx rtl;
};
union tree_node
{
  struct tree_decl decl;
};
int make_decl_rtl (tree, int);
void *
get_alias_set (t)
     tree t;
{
  long set;
  if (t->decl.rtl)
    return (t->decl.rtl->fld[1].rtmem 
	    ? 0
	    : (((t->decl.rtl ? t->decl.rtl: (make_decl_rtl (t, 0), t->decl.rtl)))->fld[1]).rtmem);
  return (void*)-1;
}

/* There should be precisely one load of ->decl.rtl.  If there is
   more than, then the dominator optimizations failed.  */
/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "dce3"} } */
  
/* There should be no loads of .rtmem since the complex return statement
   is just "return 0".  */
/* { dg-final { scan-tree-dump-times ".rtmem" 0 "dce3"} } */
  
/* There should be one IF statement (the complex return statement should
   collapse down to a simple return 0 without any conditionals).  */
/* { dg-final { scan-tree-dump-times "if " 1 "dce3"} } */