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

            Bug ID: 118000
           Summary: [avr] memcpy from __flash1 clobbers RAMPZ on EBI
                    devices
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

Created attachment 59832
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59832&action=edit
flash1.c: GNU-C99 test case

The attached flash1.c aborts on ATxmega128A1 because in

void copyf1 (void)
{
    s2 = sf1;
    const int *pz = &zval;
    __asm ("" : "+z" (pz));
    if (*pz != 1234)
        __builtin_abort ();
}

the implicit memcpy clobbers RAMPZ, and then *pz reads garbage since the hhi8
part of the address isn't zero.

Reply via email to