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

            Bug ID: 88005
           Summary: [6/7/8/9] Regression GCC on hppa misoptimisation
                    function pointer call
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skrll at netbsd dot org
  Target Milestone: ---

Here's a testcase 

----
typedef int (*pdcio_t)(int, int, ...);

pdcio_t pdc;
int pdcbuf[64] __attribute__ ((__aligned__(64)));

struct pagezero {

 int (*mem_pdc)(void);
};

void
pdc_init(void)
{
 int err;

 pdc = (pdcio_t)((struct pagezero *)0)->mem_pdc;

 err = (*pdc)(10, 2, pdcbuf, 0, 0);
}

----

Here's the generated code

----
        .LEVEL 1.1
        .text
        .align 4
.globl pdc_init
        .type   pdc_init, @function
pdc_init:
        .PROC
        .CALLINFO FRAME=0,NO_CALLS
        .ENTRY
        ldw 0(%r0),%r28
        addit,<> 1,%r0,%r0
        .EXIT
        .PROCEND
        .size   pdc_init, .-pdc_init
        .comm   pdcbuf,256,64
        .comm   pdc,4,4
        .ident  "GCC: (GNU) 9.0.0 20181112 (experimental)"
---

Reply via email to