public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Crash when cross compiling for ARM with GCC-8-2-0 and -ftree-loop-distribute-patterns
@ 2019-10-16 13:19 Josef Wolf
  2019-10-16 13:30 ` Matthias Pfaller
  2019-10-16 18:18 ` Martin Sebor
  0 siblings, 2 replies; 26+ messages in thread
From: Josef Wolf @ 2019-10-16 13:19 UTC (permalink / raw)
  To: gcc-help

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@raven.inka.de

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2019-10-18 14:34 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 13:19 Crash when cross compiling for ARM with GCC-8-2-0 and -ftree-loop-distribute-patterns Josef Wolf
2019-10-16 13:30 ` Matthias Pfaller
2019-10-17  8:10   ` Josef Wolf
2019-10-16 18:18 ` Martin Sebor
2019-10-17 11:40   ` Josef Wolf
2019-10-17 12:37     ` Matthias Pfaller
2019-10-17 14:10       ` Josef Wolf
2019-10-17 14:55         ` Richard Earnshaw (lists)
2019-10-18  9:00           ` Josef Wolf
2019-10-18 10:26             ` Richard Earnshaw (lists)
2019-10-18 12:10               ` Josef Wolf
2019-10-18 13:07                 ` Segher Boessenkool
2019-10-18 13:40                   ` Josef Wolf
2019-10-18 12:50               ` Josef Wolf
2019-10-18 14:04                 ` Richard Earnshaw (lists)
2019-10-18  9:10     ` Propagating addresses from linker to the runtie (was: Re: Crash when cross compiling for ARM with GCC-8-2-0 and) -ftree-loop-distribute-patterns Josef Wolf
2019-10-18  9:15       ` Propagating addresses from linker to the runtie Florian Weimer
2019-10-18  9:50         ` Josef Wolf
2019-10-18 10:47           ` Florian Weimer
2019-10-18 12:51             ` Segher Boessenkool
2019-10-18 12:56               ` Florian Weimer
2019-10-18 14:14                 ` Segher Boessenkool
2019-10-18 14:34                   ` Florian Weimer
2019-10-18 13:30               ` Josef Wolf
2019-10-18 14:20                 ` Segher Boessenkool
2019-10-18 13:10   ` Crash when cross compiling for ARM with GCC-8-2-0 and -ftree-loop-distribute-patterns Josef Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).