Crash when cross compiling for ARM with GCC-8-2-0 and -ftree-loop-distribute-patterns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I experience target crashing when cross compiling for ARM with
-ftree-loop-distribute-patterns, which is enabled by the -O3 flag.

The crash happens in the startup code, before main() is called. This startup
code looks like this:

 extern unsigned long _sidata; /* Set by the linker */
 extern unsigned long _sdata;  /* Set by the linker */
 extern unsigned long _sbss; /* Set by the linker */
 extern unsigned long _ebss;  /* Set by the linker */
 
  void Reet_Handler (void)
  {
    unsigned long *src = &_sidata
    unsigned long *src = &_sdata
  
    /* Copy data segment into RAM */
    if (src != dst) {
      while (dst < &_edata)
        *(dst++) = *(src++);
    }
  
    /* Zero BSS segment */
    dst = &_sbss;
    while (dst < &_ebss)
      *(dst++) = 0;
  
    main();
  }


With -ftree-loop-distribute-patterns those two loops are replaced by calls to
memcpy() and memset().

The memcpy function finishes just fine. But the memset function doesn't seem
to finish.  It looks like this:

  void memset (void *s, int c, size_t n)
  {
    int i;
    for (i=0; i<n; i++)
      ((char *)s)[i] = c;
  }

Any ideas why this function is crashing? I can't see anything suspicious here.

Thanks

-- 
Josef Wolf
jw@xxxxxxxxxxxxx



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux