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

--- Comment #6 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Can't reproduce on the trunk, neither on x86_64-linux with -Os -g3
> -fshort-enums, nor on arm-linux-gnueabi with -Os -g3 -fshort-enums
> -mcpu=cortex-m0 -mthumb

I tried -O2 -g -fshort-enums and this fails on AArch64:

extern enum my_enum_type extern_enum;
extern void bar(int a);

enum my_enum_type {
    my_entry
};

void g(void);
void foo(int a)
{
    int local_enum = extern_enum;

    if (a) {
        g();
        local_enum = 0;
    }
    bar(local_enum);
}

The issue is the placement of the extern enum declaration. Move it after the
enum type and all is well - the assert in cfgexpand seems to not allow SI/QI
combination.

Reply via email to