[Bug c/79530] New: GCC segfault when calling weakref+alias functions within __transaction_atomic block

2017-02-15 Thread tdz at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79530

Bug ID: 79530
   Summary: GCC segfault when calling weakref+alias functions
within __transaction_atomic block
   Product: gcc
   Version: 6.3.1
Status: UNCONFIRMED
  Keywords: trans-mem
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tdz at users dot sourceforge.net
  Target Milestone: ---

Created attachment 40748
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40748&action=edit
Test case (simply run 'make')

GCC version: gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
Linux system: Fedora 24 (x86_64)

STR:

  - call a weakref'ed function alias (__attribute__((weakref, alias(...
from within __transaction_atomic{}

Expected result:

  - GCC should generate a call to the target function

Actual result:

  - GCC quits with a segmentation fault:

> main.c: In function 'main':
> main.c:23:1: internal compiler error: Segmentation fault
>  }
>  ^


The attached test case builds and runs if the __transaction_atomic statement
has been removed. The target symbol has to be in a separate object file to
trigger the bug.

[Bug c/79530] GCC segfault when calling weakref+alias functions within __transaction_atomic block

2017-02-15 Thread tdz at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79530

--- Comment #1 from tdz at users dot sourceforge.net ---
Full gcc output with -v -save-temps:

cc -Wall -std=c11 -fgnu-tm -v -save-temps   -c -o main.o main.c
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC) 
COLLECT_GCC_OPTIONS='-Wall' '-std=c11' '-fgnu-tm' '-v' '-save-temps' '-c' '-o'
'main.o' '-mtune=generic' '-march=x86-64' '-pthread'
 /usr/libexec/gcc/x86_64-redhat-linux/6.3.1/cc1 -E -quiet -v -D_REENTRANT
main.c -mtune=generic -march=x86-64 -std=c11 -Wall -fgnu-tm -fpch-preprocess -o
main.i
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/6.3.1/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include
 /usr/local/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-Wall' '-std=c11' '-fgnu-tm' '-v' '-save-temps' '-c' '-o'
'main.o' '-mtune=generic' '-march=x86-64' '-pthread'
 /usr/libexec/gcc/x86_64-redhat-linux/6.3.1/cc1 -fpreprocessed main.i -quiet
-dumpbase main.c -mtune=generic -march=x86-64 -auxbase-strip main.o -Wall
-std=c11 -version -fgnu-tm -o main.s
GNU C11 (GCC) version 6.3.1 20161221 (Red Hat 6.3.1-1) (x86_64-redhat-linux)
compiled by GNU C version 6.3.1 20161221 (Red Hat 6.3.1-1), GMP version
6.1.1, MPFR version 3.1.5, MPC version 1.0.2, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C11 (GCC) version 6.3.1 20161221 (Red Hat 6.3.1-1) (x86_64-redhat-linux)
compiled by GNU C version 6.3.1 20161221 (Red Hat 6.3.1-1), GMP version
6.1.1, MPFR version 3.1.5, MPC version 1.0.2, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 30e28ecca4073452adf1455186bf479a
main.c: In function 'main':
main.c:23:1: internal compiler error: Segmentation fault
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccnEWABR.out file, please attach this to
your bugreport.
: recipe for target 'main.o' failed
make: *** [main.o] Error 1

[Bug c/79530] GCC segfault when calling weakref+alias functions within __transaction_atomic block

2017-02-15 Thread tdz at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79530

--- Comment #2 from tdz at users dot sourceforge.net ---
Created attachment 40749
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40749&action=edit
main.i from gcc -save-temps

[Bug c/79530] GCC segfault when calling weakref+alias functions within __transaction_atomic block

2017-02-15 Thread tdz at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79530

--- Comment #3 from tdz at users dot sourceforge.net ---
Created attachment 40750
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40750&action=edit
main.s from gcc -save-temps

[Bug c/79530] GCC segfault when calling weakref+alias functions within __transaction_atomic block

2017-02-15 Thread tdz at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79530

--- Comment #4 from tdz at users dot sourceforge.net ---
Created attachment 40751
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40751&action=edit
Preprocessed source code