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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.3
   Last reconfirmed|                            |2021-11-15
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
Here is a testcase which does not need any (predefined location) memory access
to get the failure:
struct header {
        unsigned a;
        unsigned b;
        unsigned c;
};

#define ADDR 0x400000
#define OFF 0x20

int main(void)
{
        struct header *hdr = 0;
        unsigned long ofs;
    volatile int t = 1;

        for (ofs = OFF; ofs <= OFF; ofs += 0x1000) {
                struct header *tmp;
                tmp = (struct header *)(ADDR + ofs);
                if (t) {
                        hdr = tmp;
                        break;
                }
        }

        if (hdr == 0)
                return 0;
    unsigned *tt = &hdr->b;
    if ((__SIZE_TYPE__)tt != (ADDR + OFF + __builtin_offsetof(struct header,
b)))
      __builtin_abort();
        return 0;
}

Reply via email to