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

--- Comment #8 from Nicholas Krause <xerofoify at gmail dot com> ---
(In reply to Jakub Jelinek from comment #7)
> This does happen even with 9.2 and current trunk, you just need to read the
> first line in #c0.

While I ran it as on a Ubuntu 9.2 Toolchain configured as:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-9ubuntu2'
--with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-9
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-gcc -c test.c-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--with-target-system-zlib=auto --enable-multiarch --disable-werror
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2) 

like this:
gcc -c test.c

and this is my source code:
void foo () {}
  2 #pragma weak foo = _foo
  3 int _foo = 0;

and I get this:
test.c:1:6: error: ‘foo’ defined both normally and as ‘alias’ attribute
    1 | void foo () {}
      |      ^~~
test.c:1:6: error: ‘foo’ alias between function and variable is not supported
test.c:3:5: note: aliased declaration here
    3 | int _foo = 0;
      |     ^~~~
test.c:1: confused by earlier errors, bailing out

So no it does not appear to segfault on 9.2 not sure about trunk.

Reply via email to