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

            Bug ID: 97413
           Summary: gcc-11 fails to typecheck VLA declarations on
                    emacs-27.1: error: wrong number of arguments specified
                    for 'access' attribute
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Originally observer a s build failure of emacs-27.1 on gcc-11.

Minimal reproduces:

$ cat fns.c.c
int a(long b, const int a1[b], long c, const int a2[c], int a3[c]);

$ ./xgcc -B. -c fns.c.c
fns.c.c:1:1: error: wrong number of arguments specified for 'access' attribute
    1 | int a(long b, const int a1[b], long c, const int a2[c], int a3[c]);
      | ^~~
fns.c.c:1:1: note: expected between 1 and 3, found 4

gcc-10 builds it successfully. Original emacs code is at
https://git.savannah.gnu.org/cgit/emacs.git/tree/src/fns.c#n2004 (in case I
reduced it incorrectly).

$ ./xgcc -B. -v

Reading specs from /home/slyfox/dev/git/gcc-native-quick-ggdb3/gcc/specs
COLLECT_GCC=/home/slyfox/dev/git/gcc-native-quick-ggdb3/gcc/xgcc
COLLECT_LTO_WRAPPER=/home/slyfox/dev/git/gcc-native-quick-ggdb3/gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--enable-languages=c,c++ --disable-bootstrap --with-multilib-list=m64
--prefix=/home/slyfox/dev/git/gcc-native-quick-ggdb3/../gcc-native-quick-installed-ggdb3
--disable-nls --without-isl --disable-libsanitizer --disable-libvtv
--disable-libgomp --disable-libstdcxx-pch --disable-libunwind-exceptions
CFLAGS='-O0 -ggdb3 ' CXXFLAGS='-O0 -ggdb3 ' --enable-valgrind-annotations
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20201013 (experimental) (GCC)

Reply via email to