[Bug rtl-optimization/68910] [5/6 regression] huge stack frame and poor code with instruction scheduling at -O2

sebastian.huber@embedded-brains.de gcc-bugzilla@gcc.gnu.org
Mon Dec 21 07:13:00 GMT 2015


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

--- Comment #14 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
(In reply to Eric Botcazou from comment #13)
> Thanks for reporting the problem.

Thanks for the quick fix.

The stack frame is still larger than necessary at least on the -mcpu=cypress
and -mcpu=leon3 targets. However, the range is similar to GCC 4.3.2, so this
looks like an old problem.

sparc-rtems4.12-gcc -S -O2 sha512c.i -mcpu=leon3

        .file   "sha512c.i"
        .section        ".text"
        .align 4
        .global SHA512_Transform
        .type   SHA512_Transform, #function
        .proc   020
SHA512_Transform:
        save    %sp, -2760, %sp
        mov     128, %o2
        mov     %i1, %o1
        add     %fp, -640, %o0
        call    memcpy, 0
         st     %i0, [%fp+68]
        add     %fp, -640, %g4
        add     %fp, -128, %o4
        ld      [%g4+116], %i1
.LL8:
[...]
        bne     .LL7
         add    %fp, -704, %o3
        jmp     %i7+8
         restore
        .size   SHA512_Transform, .-SHA512_Transform
        .ident  "GCC: (GNU) 6.0.0 20151221 (experimental)

Your reduced test case gcc.target/sparc/20151219-1.c doesn't show this large
stack frame.


More information about the Gcc-bugs mailing list