(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
ipa/
pr63595.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fdump-ipa-icf-details"  } */
       3  /* { dg-require-effective-target ptr32plus } */
       4  
       5  typedef int size_t;
       6  
       7  typedef struct TypHeader {
       8      unsigned long size;
       9      struct TypHeader * * ptr;
      10      char name[3];
      11      unsigned char type;
      12  } * TypHandle;
      13  
      14  __attribute__((noinline))
      15  static TypHandle Error(const char *str, unsigned long l1, unsigned long l2)
      16  {
      17    return 0;
      18  }
      19  
      20  extern TypHandle (* EvTab[81]) ( TypHandle hd );
      21  extern TypHandle (*TabProd[28][28]) ( TypHandle, TypHandle );
      22  
      23  __attribute__((noinline))
      24  TypHandle FunOnRight (TypHandle hdCall)
      25  {
      26      TypHandle hdRes;
      27      TypHandle hdPnt;
      28      TypHandle hdElm;
      29  
      30  
      31      if ( ((hdCall)->size) != 3*((size_t)sizeof(TypHandle)) )
      32          return Error("",0L,0L);
      33      hdPnt = ((long)(((TypHandle*)((hdCall)->ptr))[1])&1 ? (((TypHandle*)((hdCall)->ptr))[1]) : (* EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 : ((((TypHandle*)((hdCall)->ptr))[1])->type))])((((TypHandle*)((hdCall)->ptr))[1])));
      34      hdElm = ((long)(((TypHandle*)((hdCall)->ptr))[2])&1 ? (((TypHandle*)((hdCall)->ptr))[2]) : (* EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[2]) & 1) ? 1 : ((((TypHandle*)((hdCall)->ptr))[2])->type))])((((TypHandle*)((hdCall)->ptr))[2])));
      35  
      36  
      37      hdRes = ((*TabProd[(((long)(hdPnt) & 1) ? 1 : ((hdPnt)->type))][(((long)(hdElm) & 1) ? 1 : ((hdElm)->type))])((hdPnt),(hdElm)));
      38      return hdRes;
      39  }
      40  
      41  __attribute__((noinline))
      42  TypHandle FunOnLeft (TypHandle hdCall)
      43  {
      44      TypHandle hdRes;
      45      TypHandle hdPnt;
      46      TypHandle hdElm;
      47  
      48  
      49      if ( ((hdCall)->size) != 3*((size_t)sizeof(TypHandle)) )
      50          return Error("",0L,0L);
      51      hdPnt = ((long)(((TypHandle*)((hdCall)->ptr))[1])&1 ? (((TypHandle*)((hdCall)->ptr))[1]) : (* EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 : ((((TypHandle*)((hdCall)->ptr))[1])->type))])((((TypHandle*)((hdCall)->ptr))[1])));
      52      hdElm = ((long)(((TypHandle*)((hdCall)->ptr))[2])&1 ? (((TypHandle*)((hdCall)->ptr))[2]) : (* EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[2]) & 1) ? 1 : ((((TypHandle*)((hdCall)->ptr))[2])->type))])((((TypHandle*)((hdCall)->ptr))[2])));
      53  
      54  
      55      hdRes = ((*TabProd[(((long)(hdElm) & 1) ? 1 : ((hdElm)->type))][(((long)(hdPnt) & 1) ? 1 : ((hdPnt)->type))])((hdElm),(hdPnt)));
      56      return hdRes;
      57  }
      58  
      59  int main()
      60  {
      61    return 0;
      62  }
      63  
      64  /* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf"  } } */
      65  /* { dg-final { scan-ipa-dump "PHI results are different" "icf"  } } */