[Bug other/96628] Feature request: __attribute__((no_builtin("Foo")))

2020-08-16 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96628

--- Comment #2 from Andreas Schwab  ---
There is -fno-builtin-memset.

[Bug libstdc++/96626] utf-8 string literal not convertible to std::string with -std=c++20

2020-08-16 Thread rcopley at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96626

R Copley  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from R Copley  ---
This is as specified[1][2].

[1] http://eel.is/c++draft/diff.cpp17.input.output
[2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0482r6.html

[Bug c++/61372] Add warning to detect noexcept functions that might throw

2020-08-16 Thread dcrocker at eschertech dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61372

David Crocker  changed:

   What|Removed |Added

 CC||dcrocker at eschertech dot com

--- Comment #1 from David Crocker  ---
I too would find this very useful. However, it's essential that functions
declared 'extern "C" ' are (or optionally can be) assumed to not throw
exceptions. Otherwise, calls to C library functions and MCU vendor-supplied C
header files from C++ functions declared 'noexcept' will trigger this warning.
Also, the warning should be disabled when -fno-exceptions is used.

[Bug c++/96630] New: dangling reference accepted in constexpr evaluation

2020-08-16 Thread gccbugbjorn at fahller dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96630

Bug ID: 96630
   Summary: dangling reference accepted in constexpr evaluation
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gccbugbjorn at fahller dot se
  Target Milestone: ---

Created attachment 49065
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49065&action=edit
Example code

This program uses a reference to an out-of-scope local variable in constexpr
context.

struct ii
{
int v;
constexpr const int& get() const { return v;}
constexpr ii& inc() { ++v; return *this;}
};

struct wrap
{
ii i;
constexpr const int& getnext() const { auto copy = i; return
copy.inc().get();}
};

template  struct S {};
S s;

It is, however, accepted and compiles. If used in runtime evaluation, the
undefined behaviour causes wildly different results depending on optimization
level.

bf :-) confuciusornis /tmp> g++-10 --version
g++-10 (Ubuntu 10-20200411-0ubuntu1) 10.0.1 20200411 (experimental) [master
revision bb87d5cc77d:75961caccb7:f883c46b4877f637e0fa5025b4d6b5c9040ec566]
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bf :-) confuciusornis /tmp> g++-10 -std=c++20 -c -Wall -Wextra -pedantic t.cpp
bf :-) confuciusornis /tmp> 


Godbolt link: https://godbolt.org/z/8q91dv

[Bug middle-end/96625] Unnecessarily large assembly generated when a bit-offsetted higher-end end of a uint64_t-backed bitfield is shifted toward the high end (left) by its bit-offset

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96625

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
   Keywords||missed-optimization
  Component|c   |middle-end

[Bug fortran/96613] SIGFPE on min1() with -ffpe-trap=invalid switch

2020-08-16 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96613

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #3 from anlauf at gcc dot gnu.org ---
Created attachment 49066
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49066&action=edit
WIP patch

The underlying issue is visible in the tree-dump, see also comment#1 by Steve.
Changing the type and kind of the temporary to a common argument one instead
of the result, the issue is fixed.  Playing around a little bit, one finds that
even the GNU extension to MIN/MAX, allowing different argument kinds, is fishy.

The attached patch appears regtesting fine, but the coverage of the borderline
cases is insufficient yet.

I'm not sure I got the GIMPLE magic right everywhere, so the patch may need
extended testing before submitting.

[Bug fortran/96613] SIGFPE on min1() with -ffpe-trap=invalid switch

2020-08-16 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96613

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Keywords||wrong-code
   Assignee|unassigned at gcc dot gnu.org  |anlauf at gcc dot 
gnu.org

[Bug c/96631] New: Incorrect optimization of memcmp with zero-filled buffer

2020-08-16 Thread blashyrkh at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96631

Bug ID: 96631
   Summary: Incorrect optimization of memcmp with zero-filled
buffer
   Product: gcc
   Version: 9.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: blashyrkh at inbox dot ru
  Target Milestone: ---

Created attachment 49067
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49067&action=edit
Preprocessed source

memcmp of static const buffer filled with zeroes and non-const buffer starting
with zero (other bytes are non-zeroes) returns 0 if compiled with -O2 or -O3.

Compiler command line: gcc -v --save-temps -O2 memcmptest.c

Compiler output:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-9.3.0-r1/work/gcc-9.3.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/9.3.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 9.3.0-r1 p3' --disable-esp --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libada --disable-systemtap
--enable-vtable-verify --enable-lto --without-isl --enable-default-pie
--enable-default-ssp
Thread model: posix
gcc version 9.3.0 (Gentoo 9.3.0-r1 p3) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O2' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/cc1 -E -quiet -v memcmptest.c
-mtune=generic -march=x86-64 -O2 -fpch-preprocess -o memcmptest.i
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O2' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/cc1 -fpreprocessed memcmptest.i
-quiet -dumpbase memcmptest.c -mtune=generic -march=x86-64 -auxbase memcmptest
-O2 -version -o memcmptest.s
GNU C17 (Gentoo 9.3.0-r1 p3) version 9.3.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2,
MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C17 (Gentoo 9.3.0-r1 p3) version 9.3.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2,
MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: b5264bf09fb15fef9b8caba6bb13d5fc
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O2' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/as
-v --64 -o memcmptest.o memcmptest.s
GNU assembler version 2.33.1 (x86_64-pc-linux-gnu) using BFD version (Gentoo
2.33.1 p2) 2.33.1
COMPILER_PATH=/usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/:/usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O2' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/collect2 -plugin
/usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/liblto_plugin.so
-plugin-opt=/usr/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
-plugin-opt=-fresolution=memcmptest.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--eh-frame-hdr

[Bug middle-end/95189] [9/10 Regression] memcmp being wrongly stripped like strcmp

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|10.3|9.4

[Bug middle-end/96631] Incorrect optimization of memcmp with zero-filled buffer

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96631

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
Dup of bug 95189.

*** This bug has been marked as a duplicate of bug 95189 ***

[Bug middle-end/95189] [9/10 Regression] memcmp being wrongly stripped like strcmp

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189

Andrew Pinski  changed:

   What|Removed |Added

 CC||blashyrkh at inbox dot ru

--- Comment #14 from Andrew Pinski  ---
*** Bug 96631 has been marked as a duplicate of this bug. ***

[Bug c/96632] New: missed-optimization with conditionally unsetting bits in memory.

2020-08-16 Thread goldstein.w.n at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96632

Bug ID: 96632
   Summary: missed-optimization with conditionally unsetting bits
in memory.
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: goldstein.w.n at gmail dot com
  Target Milestone: ---

https://stackoverflow.com/questions/63432157/why-does-gcc-use-btq-in-conjunction-with-btcq-when-conditionally-set-a-bit-in-a

Basically:

void __attribute__((noinline))
cond_unset_bit(uint64_t * v, uint32_t b) {
if(__builtin_expect(!!(*v & ((1UL) << b)), 1)) {
*v ^= ((1UL) << b);
}
}

Compiles to:

cond_unset_bit(unsigned long*, unsigned int):
movq(%rdi), %rax
btq %rsi, %rax
jnc .L6
btcq%rsi, %rax
movq%rax, (%rdi)
.L6:
ret

The btq instruction is unnecessary.

cond_unset_bit(unsigned long*, unsigned int):
movq(%rdi), %rax
btcq%rsi, %rax
jnc .L6
movq%rax, (%rdi)
.L6:
ret


Accomplishes the same thing without the btq instruction.

[Bug tree-optimization/96633] New: missed optimization?

2020-08-16 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96633

Bug ID: 96633
   Summary: missed optimization?
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nathan at gcc dot gnu.org
  Target Milestone: ---

Matt Godbolt's https://queue.acm.org/detail.cfm?id=3372264
has an example of optimizing on amd64:

bool isWhitespace(char c)
 {
 return c == ' '
   || c == '\r'
   || c == '\n'
   || c == '\t';
 }

GCC generates: 
xorl%eax, %eax
cmpb$32, %dil
ja  .L1
movabsq $4294977024, %rax
movl%edi, %ecx
shrq%cl, %rax
andl$1, %eax
.L1:
ret

following an amazing comment on the ML, I've determined the following is abot
12% faster (and shorter too):

movabsq $4294977024, %rax
movl   %edi, %ecx
shrq%cl, %rax
shr$6, %ecx
andl$1, %eax
shrq%cl, %rax
ret

We're dealing with chars in the range [-128,128), and x86's shift operator only
considers the bottom 6 bits.

[Bug fortran/96613] SIGFPE on min1() with -ffpe-trap=invalid switch

2020-08-16 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96613

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #3)
> Created attachment 49066 [details]
> WIP patch
> 
> The underlying issue is visible in the tree-dump, see also comment#1 by
> Steve.
> Changing the type and kind of the temporary to a common argument one instead
> of the result, the issue is fixed.  Playing around a little bit, one finds
> that
> even the GNU extension to MIN/MAX, allowing different argument kinds, is
> fishy.
> 
> The attached patch appears regtesting fine, but the coverage of the
> borderline
> cases is insufficient yet.
> 
> I'm not sure I got the GIMPLE magic right everywhere, so the patch may need
> extended testing before submitting.

Hi Harald,

I started to think about doing a similar patch as you have done.
Then, after looking at F2018 where it states that MIN1() = INT(MIN()),
I thought that this might be a good candidate for frontend fix.  
Similar to thomas's frontend optimizations except except the 
transformation is always done.  That is, we should be able to do
substitutions based on Table 16.3 before we even get to backend.

[Bug c++/96634] New: missing documentation for __builtin_addressof()

2020-08-16 Thread mirq-gccboogs at rere dot qmqm.pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96634

Bug ID: 96634
   Summary: missing documentation for __builtin_addressof()
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mirq-gccboogs at rere dot qmqm.pl
  Target Milestone: ---

The __builtin_addressof() function is not documented. It is available in gcc
since r240873 (git commit be845b04a8e1).

[Bug debug/96635] New: Feature request: PDB support

2020-08-16 Thread rafael_andreas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96635

Bug ID: 96635
   Summary: Feature request: PDB support
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rafael_andreas at hotmail dot com
  Target Milestone: ---

A few years ago Microsoft has made parts of their PDB implementation public
(https://github.com/microsoft/microsoft-pdb), and PDB support is pretty much
complete in LLVM.
I think this is very useful information to implement PDB support in GCC and
further increase compatibility with the MSVC compiler.

The primary usecase for this feature is minidump support on Windows for post
mortem debugging. A user can write a crash reporting program that sends a
minidump over to the user's server(s) and then view the crash using WinDBG for
post mortem debugging. This feature will primarily be of interest to
organizations and companies, but is of interest to anybody wishing to increase
stability on Windows.

[Bug other/96628] Feature request: __attribute__((no_builtin("Foo")))

2020-08-16 Thread rafael_andreas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96628

--- Comment #3 from Rafaël Kooi  ---
(In reply to Andreas Schwab from comment #2)
> There is -fno-builtin-memset.

That still inserts a call to memset: https://godbolt.org/z/ovvq1T
Perhaps this feature is broken?

[Bug c++/96634] missing documentation for __builtin_addressof()

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96634

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
See the following thread on why we are not documenting it:
https://gcc.gnu.org/pipermail/gcc-patches/2017-January/466065.html

[Bug other/96628] Feature request: __attribute__((no_builtin("Foo")))

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96628

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Andrew Pinski  ---
You need to use -fno-tree-loop-distribute-patterns if you are implementing
memset in C.

But this is really just a dup of bug 56888.

*** This bug has been marked as a duplicate of bug 56888 ***

[Bug middle-end/56888] memcpy implementation optimized as a call to memcpy

2020-08-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888

Andrew Pinski  changed:

   What|Removed |Added

 CC||rafael_andreas at hotmail dot 
com

--- Comment #43 from Andrew Pinski  ---
*** Bug 96628 has been marked as a duplicate of this bug. ***

[Bug other/96628] Feature request: __attribute__((no_builtin("Foo")))

2020-08-16 Thread rafael_andreas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96628

--- Comment #5 from Rafaël Kooi  ---
This is not a duplicate, as this first and foremost is a feature request.
memset and other functions like this are not the only candidates where this
attribute is useful.

The attribute moves complexity out of the build system, and increases
portability, and also increases compatibility with clang.

Please reopen.

[Bug c++/96636] New: ICE in build_value_init_noctor, at cp/init.c:451

2020-08-16 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96636

Bug ID: 96636
   Summary: ICE in build_value_init_noctor, at cp/init.c:451
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Input:
//small.cc
typedef class {
  class a {}; 
  class : virtual a {};
} b;
void foo(){ b{};}

Command:
g++ small.cc

Output:
small.cc: In function ‘void foo()’:
small.cc:5:15: internal compiler error: in build_value_init_noctor, at
cp/init.c:451
5 | void foo(){ b{};}
  |   ^
0x659bfa build_value_init_noctor(tree_node*, int)
../../gcc/cp/init.c:451
0x978b75 build_value_init(tree_node*, int)
../../gcc/cp/init.c:379
0x8adee2 build_new_method_call_1
../../gcc/cp/call.c:10234
0x8b1b90 build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
../../gcc/cp/call.c:10467
0x8b1b90 build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int)
../../gcc/cp/call.c:9870
0x8b2134 perform_direct_initialization_if_possible(tree_node*, tree_node*,
bool, int)
../../gcc/cp/call.c:11966
0xab5b79 build_static_cast_1
../../gcc/cp/typeck.c:7481
0xab6f12 cp_build_c_cast(unsigned int, tree_node*, tree_node*, int)
../../gcc/cp/typeck.c:8298
0xac04ed build_functional_cast_1
../../gcc/cp/typeck2.c:2380
0xac04ed build_functional_cast(unsigned int, tree_node*, tree_node*, int)
../../gcc/cp/typeck2.c:2413
0xa6fda7 finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
../../gcc/cp/semantics.c:2977
0x9cc33a cp_parser_functional_cast
../../gcc/cp/parser.c:29684
0x9e4917 cp_parser_postfix_expression
../../gcc/cp/parser.c:7251
0x9c665a cp_parser_binary_expression
../../gcc/cp/parser.c:9641
0x9c83ee cp_parser_assignment_expression
../../gcc/cp/parser.c:9946
0x9c8712 cp_parser_expression
../../gcc/cp/parser.c:10114
0x9cbdf8 cp_parser_expression_statement
../../gcc/cp/parser.c:11774
0x9d72eb cp_parser_statement
../../gcc/cp/parser.c:11570
0x9d8ccd cp_parser_statement_seq_opt
../../gcc/cp/parser.c:11921
0x9d8da8 cp_parser_compound_statement
../../gcc/cp/parser.c:11871
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Noted that all GCC-5 onwards versions behave the same.

[Bug c++/96637] New: ICE in tree check: expected tree_list, have error_mark in cp_check_const_attributes, at cp/decl2.c:1423

2020-08-16 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96637

Bug ID: 96637
   Summary: ICE in tree check: expected tree_list, have error_mark
in cp_check_const_attributes, at cp/decl2.c:1423
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Input:
//small.cc
void foo(int[] alignas[1] alignas(1)){}

Command:
g++ small.cc

Output:
small.cc:1:23: error: expected ‘(’ before ‘[’ token
1 | void foo(int[] alignas[1] alignas(1)){}
  |   ^
  |   (
small.cc:1:36: internal compiler error: tree check: expected tree_list, have
error_mark in cp_check_const_attributes, at cp/decl2.c:1423
1 | void foo(int[] alignas[1] alignas(1)){}
  |^
0x7e9339 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9714
0x649182 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3295
0x649182 cp_check_const_attributes(tree_node*)
../../gcc/cp/decl2.c:1423
0x955b72 cp_check_const_attributes(tree_node*)
../../gcc/cp/decl2.c:1416
0x955b72 cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/cp/decl2.c:1584
0x9f27a4 cp_parser_parameter_declaration_list
../../gcc/cp/parser.c:22725
0x9f2b21 cp_parser_parameter_declaration_clause
../../gcc/cp/parser.c:22622
0x9df4f1 cp_parser_direct_declarator
../../gcc/cp/parser.c:21299
0x9df4f1 cp_parser_declarator
../../gcc/cp/parser.c:21163
0x9f4756 cp_parser_init_declarator
../../gcc/cp/parser.c:20663
0x9d4f7c cp_parser_simple_declaration
../../gcc/cp/parser.c:13811
0xa002fe cp_parser_declaration
../../gcc/cp/parser.c:13510
0xa009db cp_parser_translation_unit
../../gcc/cp/parser.c:4793
0xa009db c_parse_file()
../../gcc/cp/parser.c:44095
0xb1b9fd c_common_parse_file()
../../gcc/c-family/c-opts.c:1188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

I tested this in trunk, and this also makes released GCC "confused by earlier
errors, bailing out".

[Bug c++/96638] New: [10/11 Regression] ICE in chainon, at tree.c:3169

2020-08-16 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96638

Bug ID: 96638
   Summary: [10/11 Regression] ICE in chainon, at tree.c:3169
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Input:
//small.cc
void foo(int[] alignas[1] alignas()){}

Command:
g++ small.cc

Output:
small.cc:1:23: error: expected ‘(’ before ‘[’ token
1 | void foo(int[] alignas[1] alignas()){}
  |   ^
  |   (
small.cc:1:35: error: expected primary-expression before ‘)’ token
1 | void foo(int[] alignas[1] alignas()){}
  |   ^
small.cc:1:38: internal compiler error: in chainon, at tree.c:3169
1 | void foo(int[] alignas[1] alignas()){}
  |  ^
0x7ea11e chainon(tree_node*, tree_node*)
../../gcc/tree.c:3169
0x7ea11e chainon(tree_node*, tree_node*)
../../gcc/tree.c:3152
0x93ad08 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
../../gcc/cp/decl.c:12060
0x9f275e cp_parser_parameter_declaration_list
../../gcc/cp/parser.c:22705
0x9f2b21 cp_parser_parameter_declaration_clause
../../gcc/cp/parser.c:22622
0x9df4f1 cp_parser_direct_declarator
../../gcc/cp/parser.c:21299
0x9df4f1 cp_parser_declarator
../../gcc/cp/parser.c:21163
0x9f4756 cp_parser_init_declarator
../../gcc/cp/parser.c:20663
0x9d4f7c cp_parser_simple_declaration
../../gcc/cp/parser.c:13811
0xa002fe cp_parser_declaration
../../gcc/cp/parser.c:13510
0xa009db cp_parser_translation_unit
../../gcc/cp/parser.c:4793
0xa009db c_parse_file()
../../gcc/cp/parser.c:44095
0xb1b9fd c_common_parse_file()
../../gcc/c-family/c-opts.c:1188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

This only occurs in GCC-trunk, GCC-10 performs well in error-recovery.

[Bug target/96350] [cet] For ENDBR immediate, the binary would include a gadget that starts with a fake ENDBR64 opcode.

2020-08-16 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96350

--- Comment #5 from CVS Commits  ---
The master branch has been updated by hongtao Liu :

https://gcc.gnu.org/g:9a5381f749ee2cef51af67895de182113e45f642

commit r11-2716-g9a5381f749ee2cef51af67895de182113e45f642
Author: liuhongt 
Date:   Tue Aug 4 10:00:13 2020 +0800

Force ENDBR immediate into memory.

gcc/
PR target/96350
* config/i386/i386.c (ix86_legitimate_constant_p): Return
false for ENDBR immediate.
(ix86_legitimate_address_p): Ditto.
* config/i386/predicates.md
(x86_64_immediate_operand): Exclude ENDBR immediate.
(x86_64_zext_immediate_operand): Ditto.
(x86_64_dwzext_immediate_operand): Ditto.
(ix86_endbr_immediate_operand): New predicate.

gcc/testsuite
* gcc.target/i386/endbr_immediate.c: New test.

[Bug target/96350] [cet] For ENDBR immediate, the binary would include a gadget that starts with a fake ENDBR64 opcode.

2020-08-16 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96350

Hongtao.liu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #6 from Hongtao.liu  ---
Fixed in GCC11.

[Bug testsuite/96574] FAIL: gcc.target/i386/pr92865-1.c scan-assembler-times vmovdq[au]16[\t ] 6

2020-08-16 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96574

--- Comment #2 from Hongtao.liu  ---
This testcase is used to check vector compare to integer mask. So i deleted
scan-assembler for vmov instruction, also add -mprefer-vector-width=512 to
avoid impact of different default arch of GCC.

--- a/gcc/testsuite/gcc.target/i386/pr92865-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr92865-1.c
@@ -1,12 +1,8 @@
 /* PR target/92865 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -mavx512f -mavx512bw -mxop" } */
-/* { dg-final { scan-assembler-times "vpcmp\[bwdq\]\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vpcmpu\[bwdq\]\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]8\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]16\[\t ]" 4 } } *
-/* { dg-final { scan-assembler-times "vmovdq\[au\]32\[\t ]" 4 } } */
-/* { dg-final { scan-assembler-times "vmovdq\[au\]64\[\t ]" 4 } } */
+/* { dg-options "-Ofast -mavx512f -mavx512bw -mxop -mprefer-vector-width=512"
} */
+/* { dg-final { scan-assembler-times "vpcmp\[bwdq\]\[\t
]\[^\n\{\]*zmm\[^\n\{\]*k\[0-7\](?:\n|\[ \t\]+#)" 4 } } */
+/* { dg-final { scan-assembler-times "vpcmpu\[bwdq\]\[\t
]\[^\n\{\]*zmm\[^\n\{\]*k\[0-7\](?:\n|\[ \t\]+#)" 4 } } */

[Bug analyzer/96639] New: [11 Regression] ICE: Segmentation fault (in useless_type_conversion_p)

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96639

Bug ID: 96639
   Summary: [11 Regression] ICE: Segmentation fault (in
useless_type_conversion_p)
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20200816 snapshot (g:c99116aeeb9644ebddec653ee8b19de4d38b65bd)
ICEs when compiling the following testcase w/ -fanalyzer:

void *
calloc (__SIZE_TYPE__, __SIZE_TYPE__);

int
x7 (void)
{
  int **md = calloc (1, 1);

  return md[0][0];
}

% gcc-11.0.0 -fanalyzer -c at88dqtc.c
during IPA pass: analyzer
at88dqtc.c: In function 'x7':
at88dqtc.c:9:15: internal compiler error: Segmentation fault
9 |   return md[0][0];
  |  ~^~~
0xd7da1f crash_signal
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/toplev.c:327
0xab1798 useless_type_conversion_p(tree_node*, tree_node*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/gimple-expr.c:71
0x1108dce types_compatible_p
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/gimple-expr.h:67
0x1108dce ana::region::get_subregions_for_binding(ana::region_model_manager*,
generic_wide_int >,
generic_wide_int >, tree_node*,
auto_vec*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region.cc:262
0x113822c ana::binding_cluster::get_representative_path_vars(ana::region_model
const*, hash_set >*, ana::region const*, ana::svalue const*, auto_vec*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/store.cc:1121
0x11392e7 ana::store::get_representative_path_vars(ana::region_model const*,
hash_set >*,
ana::svalue const*, auto_vec*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/store.cc:1805
0x110dc5d ana::region_model::get_representative_path_var(ana::svalue const*,
hash_set >*)
const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1806
0x110e3a7 ana::region_model::get_representative_tree(ana::svalue const*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1851
0x10f8474 ana::impl_sm_context::get_diagnostic_tree(tree_node*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:295
0x11320df on_stmt
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/sm-malloc.cc:805
0x10f318f ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:1098
0x10f426d ana::exploded_graph::process_node(ana::exploded_node*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2526
0x10f4d5a ana::exploded_graph::process_worklist()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2341
0x10f6e8f ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4107
0x10f7aac ana::run_checkers()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4175
0x10ec468 execute
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/analyzer-pass.cc:84

[Bug analyzer/96640] New: [11 Regression] ICE in on_assignment, at analyzer/region-model.cc:561 (sorry, unimplemented: unhandled assignment op)

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96640

Bug ID: 96640
   Summary: [11 Regression] ICE in on_assignment, at
analyzer/region-model.cc:561 (sorry, unimplemented:
unhandled assignment op)
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: powerpc-*-linux-gnu

gcc-11.0.0-alpha20200816 snapshot (g:c99116aeeb9644ebddec653ee8b19de4d38b65bd)
ICEs when compiling the following testcase w/ -mvsx -fanalyzer:

void
x4 (void)
{
  __attribute__ ((altivec (vector__))) short int xy, nk;
  __builtin_vec_sra (__builtin_vec_mule (xy, nk),
(__attribute__ ((altivec (vector__))) unsigned int) {});
}

% powerpc-e300c3-linux-gnu-gcc-11.0.0 -mvsx -fanalyzer -c yhkjopg3.c
yhkjopg3.c: In function 'x4':
yhkjopg3.c:6:21: sorry, unimplemented: unhandled assignment op:
'widen_mult_even_expr'
6 | (__attribute__ ((altivec (vector__))) unsigned int)
{});
  | ^
during IPA pass: analyzer
yhkjopg3.c:6:21: internal compiler error: in on_assignment, at
analyzer/region-model.cc:561
0x113b50e ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:561
0x111ed2a ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*) const
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:1029
0x111ff65 ana::exploded_graph::process_node(ana::exploded_node*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2526
0x11207c2 ana::exploded_graph::process_worklist()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2341
0x11228a4 ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4107
0x1123551 ana::run_checkers()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4175
0x1118128 execute
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/analyzer-pass.cc:84

I also see other unhandled ops when compiling other testcases, these are
bit_insert_expr, cond_expr, and paren_expr.

I do recognize that this ICE results from a technical limitation in the
analyzer code and is not a bug per se.

[Bug analyzer/96641] New: [11 Regression] ICE in get_rvalue_1, at analyzer/region-model.cc:1082

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96641

Bug ID: 96641
   Summary: [11 Regression] ICE in get_rvalue_1, at
analyzer/region-model.cc:1082
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20200816 snapshot (g:c99116aeeb9644ebddec653ee8b19de4d38b65bd)
ICEs when compiling gcc/testsuite/gfortran.dg/goacc/clause-locations.f90 w/ -O1
-fanalyzer -fopenacc -fvar-tracking-assignments:

% powerpc-e300c3-linux-gnu-gfortran-11.0.0 -O1 -fanalyzer -fopenacc
-fvar-tracking-assignments -w -c
gcc/testsuite/gfortran.dg/goacc/clause-locations.f90
gcc/testsuite/gfortran.dg/goacc/clause-locations.f90:9:27:

9 | !$acc loop reduction(+:sum)
  |   ^
note: location of the previous reduction for 'sum'
during IPA pass: analyzer
gcc/testsuite/gfortran.dg/goacc/clause-locations.f90:8:0:

8 |   !$acc parallel
  |
internal compiler error: in get_rvalue_1, at analyzer/region-model.cc:1082
0x6ffe96 ana::region_model::get_rvalue_1(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1082
0x11c8fc3 ana::region_model::get_rvalue(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1173
0x11b30b1 ana::impl_sm_context::warn_for_state(ana::supernode const*, gimple
const*, tree_node*, unsigned int, ana::pending_diagnostic*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:259
0x11ea426 on_stmt
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/sm-malloc.cc:807
0x11acf7b ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*) const
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:1098
0x11ae035 ana::exploded_graph::process_node(ana::exploded_node*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2526
0x11ae892 ana::exploded_graph::process_worklist()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2341
0x11b0974 ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4107
0x11b1621 ana::run_checkers()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4175
0x11a61f8 execute
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/analyzer-pass.cc:84

[Bug analyzer/96642] New: [11 Regression] ICE in in apply_ctor_to_region, at analyzer/store.cc:418

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96642

Bug ID: 96642
   Summary: [11 Regression] ICE in in apply_ctor_to_region, at
analyzer/store.cc:418
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20200816 snapshot (g:c99116aeeb9644ebddec653ee8b19de4d38b65bd)
ICEs when compiling the following testcase w/ -fanalyzer:

void
ut (void)
{
  struct {
char *cc;
  } sr[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, "", 0, 0, "",
0, 0, "", 0, 0, "", 0, 0, "", 0, 0, "", 0, 0, 0, 0, 0,
  };
}

% gcc-11.0.0 -fanalyzer -c q9xpzl6a.c
during IPA pass: analyzer
q9xpzl6a.c: In function 'ut':
q9xpzl6a.c:6:5: internal compiler error: in apply_ctor_to_region, at
analyzer/store.cc:418
6 |   } sr[] = {
  | ^~
0x723164 ana::binding_map::apply_ctor_to_region(ana::region const*, tree_node*,
ana::region_model_manager*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/store.cc:418
0x113c937 ana::binding_map::apply_ctor_to_region(ana::region const*,
tree_node*, ana::region_model_manager*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/store.cc:415
0x11089f6
ana::decl_region::maybe_get_constant_value(ana::region_model_manager*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region.cc:896
0x110ce92 ana::region_model::get_store_value(ana::region const*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1197
0x110f478 ana::region_model::get_rvalue(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1173
0x110f478 ana::region_model::get_rvalue(tree_node*, ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1186
0xef4 ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:547
0x10f3022 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:1029
0x10f426d ana::exploded_graph::process_node(ana::exploded_node*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2526
0x10f4d5a ana::exploded_graph::process_worklist()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2341
0x10f6e8f ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4107
0x10f7aac ana::run_checkers()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4175
0x10ec468 execute
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/analyzer-pass.cc:84

[Bug analyzer/96643] New: [11 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:1288

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96643

Bug ID: 96643
   Summary: [11 Regression] ICE in deref_rvalue, at
analyzer/region-model.cc:1288
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-11.0.0-alpha20200816 snapshot (g:c99116aeeb9644ebddec653ee8b19de4d38b65bd)
ICEs when compiling the following testcase w/ -O1 -fanalyzer:

int l0;

class qv {
public:
  int operator[] (int b1) const { return k2[b1]; }

private:
  int *k2;
};

class g0 {
  qv nf, v6;

  void
  iq ();
};

void
g0::iq ()
{
  for (;;)
if (nf[0] == 0)
  ++l0;
}

% g++-11.0.0 -O1 -fanalyzer -c sgmectcu.cc
during IPA pass: analyzer
sgmectcu.cc: In member function 'void g0::iq()':
sgmectcu.cc:5:47: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:1288
5 |   int operator[] (int b1) const { return k2[b1]; }
  |   ^
0x7e490c ana::region_model::deref_rvalue(ana::svalue const*, tree_node*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1288
0x13723d1 ana::region_model::get_lvalue_1(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:982
0x13727b3 ana::region_model::get_lvalue(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1055
0x1372e7f ana::region_model::get_rvalue_1(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1103
0x1373218 ana::region_model::get_rvalue(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1173
0x1373218 ana::region_model::get_rvalue(tree_node*, ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1186
0x1375c94 ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:547
0x1356dc2 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:1029
0x135800d ana::exploded_graph::process_node(ana::exploded_node*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2526
0x1358afa ana::exploded_graph::process_worklist()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2341
0x135ac2f ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4107
0x135b84c ana::run_checkers()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4175
0x1350208 execute
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/analyzer-pass.cc:84

[Bug c/94579] OVS compiled with gcc10 with -fanalyzer since r10-7502-ga96f1c38a787fbc8

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94579

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #4 from Arseny Solokha  ---
It is probably a duplicate of PR94503.

[Bug analyzer/96644] New: [11 Regression] ICE in get_region_for_unexpected_tree_code, at analyzer/region-model-manager.cc:930

2020-08-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96644

Bug ID: 96644
   Summary: [11 Regression] ICE in
get_region_for_unexpected_tree_code, at
analyzer/region-model-manager.cc:930
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20200816 snapshot (g:c99116aeeb9644ebddec653ee8b19de4d38b65bd)
ICEs when compiling the following testcase w/ -O1 -fanalyzer:

int oh[1];
int *x3;

int *
cm (char *m0)
{
  return oh;
}

void
ek (void)
{
  for (;;)
{
  char *b2 = 0;

  if (*b2 != 0)
++b2;

  x3 = cm (b2);
}
}

% gcc-11.0.0 -O1 -fanalyzer -c kwnoqaib.c
during IPA pass: analyzer
kwnoqaib.c: In function 'cm':
kwnoqaib.c:7:10: internal compiler error: in
get_region_for_unexpected_tree_code, at analyzer/region-model-manager.cc:930
7 |   return oh;
  |  ^~
0x7221bf
ana::region_model_manager::get_region_for_unexpected_tree_code(ana::region_model_context*,
tree_node*, dump_location_t const&)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model-manager.cc:930
0x110e6bb ana::region_model::get_lvalue_1(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:960
0x110eaa8 ana::region_model::get_lvalue(ana::path_var,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1055
0x110eaa8 ana::region_model::get_lvalue(tree_node*, ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:1066
0x110eb5a ana::region_model::on_return(greturn const*,
ana::region_model_context*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/region-model.cc:831
0x10ef3de ana::exploded_path::feasible_p(ana::logger*,
ana::feasibility_problem**, ana::engine*, ana::exploded_graph const*) const
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:2940
0x185077c ana::dedupe_winners::add(ana::logger*, shortest_paths const&, ana::exploded_graph const*, ana::saved_diagnostic*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/diagnostic-manager.cc:381
0x184e70f ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
const&)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/diagnostic-manager.cc:518
0x10f6eb4 ana::impl_run_checkers(ana::logger*)
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4121
0x10f7aac ana::run_checkers()
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/engine.cc:4175
0x10ec468 execute
   
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200816/work/gcc-11-20200816/gcc/analyzer/analyzer-pass.cc:84

[Bug c++/96614] constexpr deletion failure through pointer to base with virtual base class

2020-08-16 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96614

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2020-08-17
   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed.