https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97578

            Bug ID: 97578
           Summary: ice during IPA pass: inline
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C code:

typedef long unsigned int size_t;
   typedef unsigned char __uint8_t;
   typedef unsigned int __uint32_t;
   typedef __uint8_t uint8_t;
   typedef __uint32_t uint32_t;
   struct md5_s {
                            uint32_t nblocks;
                            uint8_t buf[64];
                            int count;
  };
   typedef struct md5_s MD5_CONTEXT;
   void * md5_write_context;
   static void md5_write(  const void *inbuf_arg , size_t inlen) {
        const unsigned char *inbuf = inbuf_arg;
        MD5_CONTEXT *hd = md5_write_context;
        if( hd->count == 64 )           transform( hd, hd->buf );
        hd->nblocks++;
        if( !inbuf )                    return;
        if( hd->count )                 md5_write( 0, 0 );
        while( inlen >= 64 )     ;
        for( ;
  inlen && hd->count < 64;
  inlen-- )                     hd->buf[hd->count++] = *inbuf++;
  }
   void * md5_final_context;
   static void md5_final( void) {
        md5_write( 0, 0);
  }
   void AddMD5(  const void *data, size_t len ) {
        md5_write(  data, len );
  }
   void EndMD5( struct md5_s *h ) {
        md5_final(  );
  }

compiled with recent gcc trunk and flag -g -O3, does this:

during IPA pass: inline
bug659.c: In function ‘AddMD5’:
bug659.c:30:9: internal compiler error: Segmentation fault
   30 |         md5_write(  data, len );
      |         ^~~~~~~~~~~~~~~~~~~~~~~
0xbd15df crash_signal
        ../../trunk.git/gcc/toplev.c:330
0xc4b608 copy_cfg_body
        ../../trunk.git/gcc/tree-inline.c:3118

The bug first seems to occur sometime between 20201022 and 20201023.

Reply via email to