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

            Bug ID: 109784
           Summary: Arrays of type std::vector do not compile correctly
                    when their size increases
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 1342367762 at qq dot com
  Target Milestone: ---

I recently upgraded gcc13 and I try to compile the following code on my ARM
Macbook

``` cpp
#include <vector>

std::vector<int> v[100010];

int main(){

    return 0;
}
```

But his compiled output is:

g++-13 -O0 test.cpp 
/var/folders/3f/qqln0_h578vcz6pgrtpqjchm0000gn/T//ccsnb1Zn.s:366:29: error:
unexpected token in '.section' directive
        .section .data.rel.ro.local
                                   ^

I compiled the same code using g++11 and it compiled successfully

the exact version of GCC:
g++-13 -v
Using built-in specs.
COLLECT_GCC=g++-13
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/aarch64-apple-darwin22/13/lto-wrapper
Target: aarch64-apple-darwin22
Configured with: ../configure --prefix=/opt/homebrew/opt/gcc
--libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls
--enable-checking=release --with-gcc-major-version-only
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-13
--with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr
--with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl
--with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 13.1.0'
--with-bugurl=https://github.com/Homebrew/homebrew-core/issues
--with-system-zlib --build=aarch64-apple-darwin22
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (Homebrew GCC 13.1.0)

the system type:
MacOS 13.3.1 (a)

the options given when GCC was configured/built:
-O0

Reply via email to