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

            Bug ID: 111558
           Summary: RISCV: shrink-wrapper optimization question
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexey.lapshin at espressif dot com
                CC: manolis.tsamis at vrull dot eu
  Target Milestone: ---

Created attachment 55977
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55977&action=edit
shrink-synthetic-example.c

When I was studying shrink-wrapping behavior, I discovered something strange
code generation.

See the code and assembly at https://godbolt.org/z/P3WfTszYn

Every branch has the same save/restore callee-saved registers.
Therefore, the shrink-wrapping optimization may reduce the speed of the
function when input parameters are not zero...

I understand that this is not a synthetic code snippet... 

But may this code generation be reproduced in real code (without asm inlining)?

Reply via email to