[Bug c++/95449] New: void_t does not work with some uses of vector_size

2020-05-31 Thread dummyddd at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95449

Bug ID: 95449
   Summary: void_t does not work with some uses of vector_size
   Product: gcc
   Version: 10.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dummyddd at gmail dot com
  Target Milestone: ---

Created attachment 48646
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48646&action=edit
Example, same as on godbolt

Since GCC 10, the default void_t implementation does not work on some
expressions with vector_size types (see attachment or
https://godbolt.org/z/72xdVZ).
void_t implementations with the CWG issue 1558 workaround still work.

GCC versions between 4.9.0 and 9.3 can compile such expressions without the
workaround (even though the fix for CWG issue 1558 wasn't required until
c++14).
I wasn't able to reduce the example more than this without getting the code to
compile in GCC 10.
Specifically, replacing "SWithSize" with
"SWithSize{ })[0])>" does work in GCC 10.

[Bug c++/95449] void_t does not work with some uses of vector_size

2020-05-31 Thread dummyddd at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95449

Lars Bonnichsen  changed:

   What|Removed |Added

  Attachment #48646|0   |1
is obsolete||

--- Comment #1 from Lars Bonnichsen  ---
Created attachment 48647
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48647&action=edit
Actually does not relate to CWG 1558

[Bug c++/50943] New: asm goto in templated code causes internal compiler segfaults

2011-11-01 Thread dummyddd at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50943

 Bug #: 50943
   Summary: asm goto in templated code causes internal compiler
segfaults
Classification: Unclassified
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: dummy...@gmail.com


Created attachment 25675
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25675
The code that causes a segfault

I tested the code in mingw-tdm64 4.5.2, 4.6.1, and under the mac port for
4.6.1, all with the same result.

$ gcc-fsf-4.6 -v -save-temps main.cpp
Using built-in specs.
COLLECT_GCC=gcc-fsf-4.6
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.6/libexec/gcc/x86_64-apple-darwin11.1.0/4.6.1/lto-wrapper
Target: x86_64-apple-darwin11.1.0
Configured with: ../gcc-4.6.1/configure --prefix=/sw
--prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man
--infodir=/sw/lib/gcc4.6/info
--enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw
--with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6
--enable-cloog-backend=isl
Thread model: posix
gcc version 4.6.1 (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.2' '-v' '-save-temps'
'-mtune=core2'
 /sw/lib/gcc4.6/libexec/gcc/x86_64-apple-darwin11.1.0/4.6.1/cc1plus -E
-quiet -v -D__DYNAMIC__ main.cpp -fPIC -mmacosx-version-min=10.7.2
-mtune=core2 -fpch-preprocess -o main.ii
ignoring nonexistent directory
"/sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin11.1.0/4.6.1/../../../../x86_64-apple-darwin11.1.0/include"
#include "..." search starts here:
#include <...> search starts here:

/sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin11.1.0/4.6.1/../../../../include/c++/4.6.1

/sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin11.1.0/4.6.1/../../../../include/c++/4.6.1/x86_64-apple-darwin11.1.0

/sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin11.1.0/4.6.1/../../../../include/c++/4.6.1/backward
 /sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin11.1.0/4.6.1/include
 /usr/local/include
 /sw/lib/gcc4.6/include
 /sw/lib/gcc4.6/lib/gcc/x86_64-apple-darwin11.1.0/4.6.1/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.2' '-v' '-save-temps'
'-mtune=core2'
 /sw/lib/gcc4.6/libexec/gcc/x86_64-apple-darwin11.1.0/4.6.1/cc1plus
-fpreprocessed main.ii -fPIC -quiet -dumpbase main.cpp
-mmacosx-version-min=10.7.2 -mtune=core2 -auxbase main -version -o main.s
GNU C++ (GCC) version 4.6.1 (x86_64-apple-darwin11.1.0)
   compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.6.1 (x86_64-apple-darwin11.1.0)
   compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: b15fbe702f97b74ba102fe17491ae6a1
main.cpp: In function ‘bool work(int*, int) [with T = int]’:
main.cpp:15:1: internal compiler error: Segmentation fault: 11
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
$ cat main.ii
# 1 "main.cpp"
# 1 ""
# 1 ""
# 1 "main.cpp"

template
bool work(int* data, int bit) {
asm goto("lock and %0, %1;"
 "jz %l[other]"
: : "r"(~(1 << bit)), "m"(data) : : other);
return false;
other:
return true;
}

int main(int argc, char** argv) {
int data = 2;
work(&data, data);
return 0;
}


[Bug c++/85864] New: template argument string literal operator with default argument doesnt work in templates

2018-05-21 Thread dummyddd at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85864

Bug ID: 85864
   Summary: template argument string literal operator with default
argument doesnt work in templates
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dummyddd at gmail dot com
  Target Milestone: ---

The following code compiles with GCC 7.3.0 and earlier, but errors with GCC
8.1.0 and trunk.

template struct String_template {};

template
constexpr String_template operator""_template() {
return String_template {};
}

template
int hex(T v) { return 1; }

template 
void tt2() {
auto h2 = hex(1);
auto h = hex(2);
}

int main() {
auto h = hex(2);
return h;
}

: In function 'void tt2()':

:14:19: error: no matching function for call to 'hex(int)'

 auto h = hex(2);

   ^

:9:5: note: candidate: 'template int hex(T)'

 int hex(T v) { return 1; }

 ^~~

:9:5: note:   template argument deduction/substitution failed:

The error is only triggered by hex(2).
The error may be related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85731