[Bug sanitizer/86899] [10/11/12/13 regression] TSAN incorrect warning: control reaches end of non-void function

2022-06-26 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86899

--- Comment #11 from Dmitry G. Dyachenko  ---
r13-1213 PASS for me
r13-1164 FAIL for me

[Bug sanitizer/104934] -fsanitize=undefined codegen err

2022-03-15 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104934

--- Comment #2 from Dmitry G. Dyachenko  ---
(In reply to Jakub Jelinek from comment #1)
> And the bug is?
> The S class doesn't have the key method defined, so some other TU needs to
> define it and thus provide the vtable and rtti for it.
> Without -fsanitize=vptr the typeinfo isn't needed on this particular
> testcase and the vtable isn't needed either, which is why you don't get an
> undefined symbol in that case and you get it with -fsanitize=vptr or
> -fsanitize=undefined that implies that.

Thank you, Jakub.
So, close as 'INVALID'?

[Bug sanitizer/104934] New: -fsanitize=undefined codegen err

2022-03-15 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104934

Bug ID: 104934
   Summary: -fsanitize=undefined codegen err
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

r12-7608 FAIL

Probably FAIL long ago: gcc-8 FAIL
gcc version 8.0.1 20180125 (experimental) [trunk revision 257061] (GCC)


$ g++ -fsanitize=undefined -c -o x.o x.ii && nm -u --reverse-sort x.o
 U _ZTI1S
$ g++ -c -o x.o x.ii && nm -u --reverse-sort x.o

$ cat x.ii
struct a {};
struct b {
  a c;
};
struct S : a {
  virtual int d();
};
struct e : b {
  unsigned f();
};
unsigned e::f() { static_cast(); return 0; }

$ ~/arch-gcc/gcc_current/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
--enable-libstdcxx-debug
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220311 (experimental) [master r12-7608-g5e28be89665] (GCC)

[Bug analyzer/104863] New: [12 regression] ICE in operator[], at vec.h:889

2022-03-10 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104863

Bug ID: 104863
   Summary: [12 regression] ICE in operator[], at vec.h:889
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r12-6649 PASS
r12-6793 FAIL
r12-7557 FAIL

$ $ cat y.i
extern void g();
struct a {
} b(int c, int d) {
  struct a *e = 0;
  int f;
  if (c & 1 || !(c & 2))
return *e;
  f = 0;
  for (; f < d - 1; f++)
g(e[1]);
}

$ gcc -fpreprocessed -O1 -fanalyzer -fanalyzer-transitivity y.i

during IPA pass: analyzer
y.i: In function ‘b’:
y.i:9:12: internal compiler error: in operator[], at vec.h:889
9 |   for (; f < d - 1; f++)
  |  ~~^~~
0xd3c09c vec::operator[](unsigned int)
/home/dimhen/src/gcc_current/gcc/vec.h:889
0xd3c54d vec::operator[](unsigned int)
/home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:2031
0xd3c54d vec::operator[](unsigned int)
/home/dimhen/src/gcc_current/gcc/vec.h:1495
0xd3c54d ana::constraint_manager::get_equiv_class_by_index(unsigned int)
/home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.h:428
0xd3c54d ana::equiv_class_id::get_obj(ana::constraint_manager&) const
/home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1462
0xd3c54d ana::constraint_manager::add_constraint_internal(ana::equiv_class_id,
ana::constraint_op, ana::equiv_class_id)
/home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1982
0x24e1671 ana::constraint_manager::add_unknown_constraint(ana::equiv_class_id,
tree_code, ana::equiv_class_id)
/home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1931
0x24e5ab0 ana::constraint_manager::add_constraint(ana::svalue const*,
tree_code, ana::svalue const*)
/home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1823
0x1783a70 ana::region_model::add_constraint(ana::svalue const*, tree_code,
ana::svalue const*, ana::region_model_context*)
/home/dimhen/src/gcc_current/gcc/analyzer/region-model.cc:3049
0x1784221 ana::region_model::add_constraint(tree_node*, tree_code, tree_node*,
ana::region_model_context*, ana::rejected_constraint**)
/home/dimhen/src/gcc_current/gcc/analyzer/region-model.cc:3077
0x177011f ana::program_state::on_edge(ana::exploded_graph&,
ana::exploded_node*, ana::superedge const*, ana::uncertainty_t*)
/home/dimhen/src/gcc_current/gcc/analyzer/program-state.cc:1035
0x175deba ana::exploded_graph::process_node(ana::exploded_node*)
/home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:3976
0x175f252 ana::exploded_graph::process_worklist()
/home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:3186
0x17615bd ana::impl_run_checkers(ana::logger*)
/home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:5765
0x176241e ana::run_checkers()
/home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:5836
0x17520a8 execute
/home/dimhen/src/gcc_current/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Command exited with non-zero status 1

$ gcc -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
--enable-libstdcxx-debug
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220309 (experimental) [master r12-7557-gd76511138dc] (GCC)

[Bug sanitizer/90347] [UBSAN] __attribute__((weak))__ results in "declared weak after being used" error

2021-12-03 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90347

--- Comment #7 from Dmitry G. Dyachenko  ---
r12-5761 PASS for me

r12-5648 FAIL
r12-5761 PASS

[Bug middle-end/77721] -Wformat-truncation not uses arg range for converted vars

2021-11-27 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77721

--- Comment #7 from Dmitry G. Dyachenko  ---
Sounds like gcc-8.0.1 PASS for me

r257061 FAIL
r258034 PASS
r12-5546 PASS

$ ~/arch-gcc/SVN/gcc_258034/bin/gcc --version
gcc (GCC) 8.0.1 20180227 (experimental) [trunk revision 258034]

$ ~/arch-gcc/SVN/gcc_258034/bin/gcc -O2 -S -Wall -Woverflow -Wconversion
-Wpedantic -Wformat-truncation=2 -xc x.c

$ cat x.c
int snprintf (char*, __SIZE_TYPE__, const char*, ...);

void foo(unsigned j, char *p)
{
if(j > 999)
return;
snprintf(p, 4, "%3u", j);
}

void bar(int j, char *p)
{
const unsigned k = (unsigned) j;
if(k > 999)
return;
snprintf(p, 4, "%3u", k);
}

[Bug tree-optimization/102814] New: [12 regression] quadratique/exponential time complexity for max-jump-thread-duplication-stmts

2021-10-18 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102814

Bug ID: 102814
   Summary: [12 regression] quadratique/exponential time
complexity for max-jump-thread-duplication-stmts
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r12-4256 FAST
r12- SLOW

g++ -fpreprocessed -std=c++98 -O2 --param max-jump-thread-duplication-stmts=NNN
-c x.ii

 r12-4256 r12-
1800.5s 0.21s
1810.8s > 100s
1901.0s 52s

cat x.ii # cvise'd from proprietary codebase
struct a {
  a operator+(int);
};
void *operator new(unsigned long, void *c) { return c; }
struct d {
  void h(int *j) { new (j) int(); }
};
struct k {
  struct {
int e;
int f;
  } g;
};
struct n : k {
  a m_fn2();
  a o();
  int m_fn4();
  int operator[](int);
  int ae;
  void s() {
if (g.e != g.f) {
  d l;
  int *b;
  l.h(b);
}
a m = o();
t(m, ae);
  }
  template  void u(a, af, af);
  void t(a, unsigned char);
};
int ah;
struct v {
  n w();
};
void x() {
  v p;
  n ak = p.w(), al, rapdu;
  int q(ak.m_fn4());
  int r;
  for (int i = 0; q; i++) {
if (i == q - 1) {
  al.s();
  r = ak.m_fn4();
}
al.s();
al.s();
al.s();
al.s();
a am, an = ak.m_fn2(), ao = an + 1, ap = ak.m_fn2(), aq = ap + ah,
  ar = aq + r;
al.u(am, ao, ar);
if (i == q - 1)
  al.s();
i &[1];
  }
}

g++ -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
--enable-libstdcxx-debug
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211015 (experimental) [master r12--ga01704fc45a] (GCC)

[Bug c/102797] ice in useless_type_conversion_p, at gimple-expr.c:87

2021-10-16 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797

--- Comment #2 from Dmitry G. Dyachenko  ---
r12-4256 PASS
r12- FAIL

$ cat x.ii
struct b {
  b(int);
};
void d() {
  int c = 1;
  do
try {
  b a = 1;
  while (1) {
c++;
a = 1;
  }
} catch (...) {
}
  while (1);
}

$ g++ -fpreprocessed -O2 -std=c++98 -c x.ii
during GIMPLE pass: evrp
x.ii: In function 'void d()':
x.ii:16:1: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
   16 | }
  | ^
0x90e691 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/dimhen/src/gcc_current/gcc/tree.c:8739
0x7fcfb1 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/dimhen/src/gcc_current/gcc/tree.h:3556
0x7fcfb1 useless_type_conversion_p(tree_node*, tree_node*)
/home/dimhen/src/gcc_current/gcc/gimple-expr.c:87
0x169677a verify_gimple_phi
/home/dimhen/src/gcc_current/gcc/tree-cfg.c:5128
0x169677a verify_gimple_in_cfg(function*, bool)
/home/dimhen/src/gcc_current/gcc/tree-cfg.c:5457
0x154ad27 execute_function_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2042
0x154b73c execute_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

$ g++ -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
--enable-libstdcxx-debug
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211015 (experimental) [master r12--ga01704fc45a] (GCC)

[Bug middle-end/102386] New: [12 regression] bogus -Wrestrict for unreachable memcpy()

2021-09-17 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102386

Bug ID: 102386
   Summary: [12 regression] bogus -Wrestrict for unreachable
memcpy()
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r12-3456 PASS
r12-3545 FAIL

$ cat x.i
static int GetHashParam_HP_OPAQUEBLOB_pdwDataLen = 0;
void *memcpy(void *, const void *, unsigned long);
typedef struct {
  int tSimpleBlobHeader;
  int bCurrKey[];
} CRYPT_OPAQUEHASHBLOB;
int GetHashParam_HP_OPAQUEBLOB() {
  CRYPT_OPAQUEHASHBLOB *pBlb;
  if (GetHashParam_HP_OPAQUEBLOB_pdwDataLen) {
void *pcn = pBlb->bCurrKey, *pdwBuff = pBlb->bCurrKey;
int dwDWBufLen = 8;
memcpy(pcn, pdwBuff, sizeof(1) * dwDWBufLen);
  }
  return 1;
}

$ gcc -fpreprocessed -O --param max-early-inliner-iterations=2 -Wrestrict -c
x.i
x.i: In function 'GetHashParam_HP_OPAQUEBLOB':
x.i:12:5: warning: 'memcpy' accessing 32 bytes at offsets 4 and 4 overlaps 32
bytes at offset 4 [-Wrestrict]
   12 | memcpy(pcn, pdwBuff, sizeof(1) * dwDWBufLen);
  | ^~~~


Test extracted from private codebase.
Key part:

static inline void foo(void *p, void *q, int N)
{
   if(p != q)
 memcpy(p, q, N);
}

void bar(void q, void p, int N)
{
   foo(p, q, N);
}

[Bug analyzer/96894] Analyzer assumes pointer is NULL, even if pointer was tested to be non-null before

2021-02-14 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96894

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #2 from Dmitry G. Dyachenko  ---
gcc version 11.0.0 20210212 (experimental) [master revision
0c27fe96f81:d6ccd7dde1c:8c4137c7ead515baaf1ac8340edeb3a442388b5b]

PASS for me

[Bug analyzer/95000] -fanalyzer confused by switch on non-int type

2021-02-11 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95000

--- Comment #5 from Dmitry G. Dyachenko  ---
gcc version 11.0.0 20210210 (experimental) [master revision
bd0e37f68a3:deed5164277:72932511053596091ad291539022b51d9f2ba418]

PASS for me

[Bug analyzer/94713] Analyzer is buggy on uninitialized pointer

2021-02-11 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94713

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #1 from Dmitry G. Dyachenko  ---
gcc version 11.0.0 20210210 (experimental) [master revision
bd0e37f68a3:deed5164277:72932511053596091ad291539022b51d9f2ba418]

PASS for me

[Bug analyzer/93695] Allocation and freeing memory for array members in loops is not handled properly by the analyzer

2021-02-11 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93695

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #2 from Dmitry G. Dyachenko  ---
gcc version 11.0.0 20210210 (experimental) [master revision
bd0e37f68a3:deed5164277:72932511053596091ad291539022b51d9f2ba418]

PASS for me

[Bug analyzer/99064] New: [11 regression] ICE analyzer::print_mem_ref

2021-02-10 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99064

Bug ID: 99064
   Summary: [11 regression] ICE analyzer::print_mem_ref
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

gcc version 11.0.0 20210104 (experimental) [master revision
7f2b7317566:9da1da01aec:39bd65faee3bafe2dc067e5fedb5079896551a8a] (GCC) 
r11-6442 PASS

gcc version 11.0.0 20210108 (experimental) [master revision
bdcde150450:e18dcf9fcae:b407f233d7c18534fbfe8f74af7f0232498fb0c4] (GCC)
r11-6550 FAIL

gcc version 11.0.0 20210210 (experimental) [master revision
bd0e37f68a3:deed5164277:72932511053596091ad291539022b51d9f2ba418] (GCC)
r11-7168 FAIL

$ cat x.ii
template  struct iterator_traits;
template  struct iterator_traits<_Tp *> {
  typedef _Tp 
};
template  struct __normal_iterator {
  _Iterator _M_current;
  __normal_iterator(_Iterator &__i) : _M_current(__i) {}
  typename iterator_traits<_Iterator>::reference operator*() {
return *_M_current;
  }
};
template  struct allocator;
template  struct allocator_traits;
template  struct allocator_traits> {
  using pointer = _Tp *;
};
struct TPkcs11Token;
struct __alloc_traits : allocator_traits> {};
struct _Vector_base {
  typedef __alloc_traits::pointer pointer;
  struct {
pointer _M_start;
  } _M_impl;
};
struct : _Vector_base {
  __normal_iterator begin() { return _M_impl._M_start; }
} list_tokens_token_list;
struct TPkcs11Token {
  int *add_info;
};
void list_tokens() {
  for (__normal_iterator base = list_tokens_token_list.begin();;) {
int *add_info = new int;
(*base).add_info = add_info;
  }
}
// cvise'd from private codebase

$ gcc_current/bin/g++ -fpreprocessed -O2 -fanalyzer -c x.ii
during IPA pass: analyzer
x.ii:34:22: internal compiler error: Segmentation fault
   34 | (*base).add_info = add_info;
  | ~^~
0x12baa3f crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:327
0xd7f150 print_mem_ref
/home/dimhen/src/gcc_current/gcc/c-family/c-pretty-print.c:2006
0xb7b035 dump_expr
/home/dimhen/src/gcc_current/gcc/cp/error.c:2367
0xb80640 expr_to_string(tree_node*)
/home/dimhen/src/gcc_current/gcc/cp/error.c:3188
0xb80d7c cp_printer
/home/dimhen/src/gcc_current/gcc/cp/error.c:4356
0x1f28c86 pp_format(pretty_printer*, text_info*)
/home/dimhen/src/gcc_current/gcc/pretty-print.c:1475
0x16533cc ana::evdesc::event_desc::formatted_print(char const*, ...) const
/home/dimhen/src/gcc_current/gcc/analyzer/pending-diagnostic.cc:64
0x1eb67a6 ana::warning_event::get_desc(bool) const
/home/dimhen/src/gcc_current/gcc/analyzer/checker-path.cc:885
0x1eb60f2 ana::checker_event::prepare_for_emission(ana::checker_path*,
ana::pending_diagnostic*, diagnostic_event_id_t)
/home/dimhen/src/gcc_current/gcc/analyzer/checker-path.cc:149
0x1ec64f3 ana::checker_path::prepare_for_emission(ana::pending_diagnostic*)
/home/dimhen/src/gcc_current/gcc/analyzer/checker-path.h:559
0x1ec64f3 ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph
const&, ana::saved_diagnostic const&, ana::exploded_path const&, gimple const*,
int)
/home/dimhen/src/gcc_current/gcc/analyzer/diagnostic-manager.cc:668
0x1ec8a80 ana::dedupe_winners::emit_best(ana::diagnostic_manager*,
ana::exploded_graph const&)
/home/dimhen/src/gcc_current/gcc/analyzer/diagnostic-manager.cc:569
0x1ec68c8 ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
const&)
/home/dimhen/src/gcc_current/gcc/analyzer/diagnostic-manager.cc:622
0x1649d32 ana::impl_run_checkers(ana::logger*)
/home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:4744
0x164aafe ana::run_checkers()
/home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:4801
0x163d568 execute
/home/dimhen/src/gcc_current/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gcc_current/bin/g++ -v   
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-

[Bug tree-optimization/98568] [11 regression] ICE in verify_gimple() during GIMPLE pass: store-merging

2021-01-06 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98568

--- Comment #1 from Dmitry G. Dyachenko  ---
$ ~/arch-gcc/r11-6475/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/r11-6475/bin/gcc
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/r11-6475/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20210105 (experimental) [master revision
26b5062be99:3cf8b6daf8d:27aad521570cbc1050ba957c0ee47aed18033dc1] (GCC)

[Bug tree-optimization/98568] New: [11 regression] ICE in verify_gimple() during GIMPLE pass: store-merging

2021-01-06 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98568

Bug ID: 98568
   Summary: [11 regression] ICE in verify_gimple() during GIMPLE
pass: store-merging
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r11-6442 PASS
r11-6475 FAIL

$ cat x.i
char a[2];
void c()
{
  int b;
  a[1] = b >> 8;
  a[0] = b;
}
// creduced from openssl-1.1.0/ssl/s3_cbc.c

$ ~/arch-gcc/r11-6475/bin/gcc -fpreprocessed -O3 -c x.i
x.i: In function 'c':
x.i:2:6: error: conversion of register to a different size in
'view_convert_expr'
2 | void c()
  |  ^
VIEW_CONVERT_EXPR(b_4(D));

_12 = VIEW_CONVERT_EXPR(b_4(D));
during GIMPLE pass: store-merging
x.i:2:6: internal compiler error: verify_gimple failed
0x10420ba verify_gimple_in_cfg(function*, bool)
/home/dimhen/src/gcc_current/gcc/tree-cfg.c:5467
0xef8497 execute_function_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2042
0xef8ebb execute_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug middle-end/94195] missing warning reading a smaller object via an lvalue of a larger type

2020-09-26 Thread dimhen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94195

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #3 from Dmitry G. Dyachenko  ---
(In reply to CVS Commits from comment #2)
> The master branch has been updated by Martin Sebor :
> 
> https://gcc.gnu.org/g:3f9a497d1b0dd9da87908a11b59bf364ad40ddca
> 
> commit r11-3306-g3f9a497d1b0dd9da87908a11b59bf364ad40ddca
> Author: Martin Sebor 
> Date:   Sat Sep 19 17:47:29 2020 -0600
> 
> Extend -Warray-bounds to detect out-of-bounds accesses to array
> parameters.
> 
> gcc/ChangeLog:
> 
> PR middle-end/82608
> PR middle-end/94195
> PR c/50584
> PR middle-end/84051
> * gimple-array-bounds.cc (get_base_decl): New function.
> (get_ref_size): New function.
> (trailing_array): New function.
> (array_bounds_checker::check_array_ref): Call them.  Handle
> arrays
> declared in function parameters.
> (array_bounds_checker::check_mem_ref):  Same.  Handle references
> to
> dynamically allocated arrays.
> 
> gcc/testsuite/ChangeLog:
> 
> PR middle-end/82608
> PR middle-end/94195
> PR c/50584
> PR middle-end/84051
> * c-c++-common/Warray-bounds.c: Adjust.
> * gcc.dg/Wbuiltin-declaration-mismatch-9.c: Adjust.
> * gcc.dg/Warray-bounds-63.c: New test.
> * gcc.dg/Warray-bounds-64.c: New test.
> * gcc.dg/Warray-bounds-65.c: New test.
> * gcc.dg/Warray-bounds-66.c: New test.
> * gcc.dg/Warray-bounds-67.c: New test.

I am a bit confused -- now gcc produces warning.
But access is not out of allocated memory.
Is it expected?


$ cat x.c
#include 

struct S1 {
  unsigned x;
};
struct S {
  struct S1 s1;
  int z;
};

void f1()
{
  struct S *pS = (struct S*) calloc(sizeof(struct S1),1);
  if(pS->s1.x == 0)
return;
  free(pS);
}

$ gcc -O2 -Wall -c x.i
x.c: In function 'f1':
x.c:18:8: warning: array subscript 'struct S[0]' is partly outside array bounds
of 'unsigned char[4]' [-Warray-bounds]
   18 |   if(pS->s1.x == 0)
  |^~
x.c:17:30: note: referencing an object of size 4 allocated by 'calloc'
   17 |   struct S *pS = (struct S*) calloc(sizeof(struct S1),1);
  |  ^~~

[Bug bootstrap/97105] New: [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Bug ID: 97105
   Summary: [11 regression] dumpfile.c:169:33: error: storage size
of 'optgroup_options' isn't known
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r11-3264 PASS
r11-3279 FAIL

$ configure --enable-checking=release --enable-languages=c,c++,lto
--disable-multilib --enable-shared
$ make -j5
[...]

make[3]: Entering directory '/home/dimhen/build/gcc_current/gcc'
/home/dimhen/build/gcc_current/./prev-gcc/xg++
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/home/dimhen/arch-gcc/gcc_current/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/dimhen/src/gcc_current/libstdc++-v3/libsupc++
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c   -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror   -DHAVE_CONFIG_H -I. -I.
-I/home/dimhen/src/gcc_current/gcc -I/home/dimhen/src/gcc_current/gcc/.
-I/home/dimhen/src/gcc_current/gcc/../include
-I/home/dimhen/src/gcc_current/gcc/../libcpp/include
-I/home/dimhen/build/gcc_current/./gmp -I/home/dimhen/src/gcc_current/gmp
-I/home/dimhen/build/gcc_current/./mpfr/src
-I/home/dimhen/src/gcc_current/mpfr/src -I/home/dimhen/src/gcc_current/mpc/src 
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber/bid -I../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libbacktrace
-I/home/dimhen/build/gcc_current/./isl/include
-I/home/dimhen/src/gcc_current/isl/include  -o dumpfile.o -MT dumpfile.o -MMD
-MP -MF ./.deps/dumpfile.TPo /home/dimhen/src/gcc_current/gcc/dumpfile.c
/home/dimhen/src/gcc_current/gcc/coretypes.h: In instantiation of 'struct
kv_pair':
/home/dimhen/src/gcc_current/gcc/dumpfile.c:169:50:   required from here
/home/dimhen/src/gcc_current/gcc/dumpfile.c:169:33: error: storage size of
'optgroup_options' isn't known
  169 | const kv_pair optgroup_options[] =
  | ^~~~
/home/dimhen/src/gcc_current/gcc/dumpfile.c: In function 'void
dump_loc(dump_flags_t, pretty_printer*, location_t)':
/home/dimhen/src/gcc_current/gcc/dumpfile.c:498:34: warning: spurious trailing
space in format [-Wformat-diag]
  498 | pp_printf (pp, "%s:%d:%d: ", LOCATION_FILE (loc),
  |  ^
/home/dimhen/src/gcc_current/gcc/dumpfile.c:501:34: warning: spurious trailing
space in format [-Wformat-diag]
  501 | pp_printf (pp, "%s:%d:%d: ",
  |  ^
/home/dimhen/src/gcc_current/gcc/dumpfile.c:505:26: warning: spurious trailing
space in format [-Wformat-diag]
  505 |   pp_printf (pp, "%s: ", kind_as_string (dump_kind));
  |  ^
/home/dimhen/src/gcc_current/gcc/dumpfile.c: In member function 'void
dump_context::begin_scope(const char*, const dump_user_location_t&, const
dump_impl_location_t&)':
/home/dimhen/src/gcc_current/gcc/dumpfile.c:1122:20: warning: spurious leading
punctuation sequence '===' in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |^~~
/home/dimhen/src/gcc_current/gcc/dumpfile.c:1122:27: warning: unquoted sequence
of 3 consecutive punctuation characters '===' in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |   ^~~
/home/dimhen/src/gcc_current/gcc/dumpfile.c:1122:30: warning: unquoted
whitespace character '\x0a' in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |  ^~
make[3]: *** [Makefile:1123: dumpfile.o] Error 1
make[3]: Leaving directory '/home/dimhen/build/gcc_current/gcc'
make[2]: *** [Makefile:4793: all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/dimhen/build/gcc_current'
make[1]: *** [Makefile:27160: stage2-bubble] Error 2
make[1]: Leaving directory '/home/dimhen/build/gcc_current'

[Bug c/97087] [11 regression] 70x slow -O3

2020-09-17 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97087

--- Comment #1 from Dmitry G. Dyachenko  ---
Created attachment 49235
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49235=edit
unreduced file

preprocessed openssl-1.1.0 crypto/blake2/blake2s.c
compilition aborted after ~1h

[Bug c/97087] New: [11 regression] 70x slow -O3

2020-09-17 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97087

Bug ID: 97087
   Summary: [11 regression] 70x slow -O3
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

Created attachment 49234
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49234=edit
-O3 slowdown 70x

gcc -O3 -c y.i
r11-3192 0.06s
r11-3210 3.45s
r11-3234 3.61s

gcc -O2 -c y.i
r11-3192 0.05s
r11-3210 0.05s
r11-3234 0.05s

$ ~/arch-gcc/gcc_current/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20200916 (experimental) [master revision
7d1be939e0f:e8cbe88c94b:aab6194d0898f5c592708fe2d44a14046b4d9097] (GCC)

[Bug tree-optimization/95761] [11 regression] ICE during GIMPLE pass: slp verify_ssa failed

2020-06-24 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95761

--- Comment #8 from Dmitry G. Dyachenko  ---
(In reply to Martin Liška from comment #7)
> I see the test-cases fixed.
> Can you still reproduce that?

r11-1553 PASS x_1.i for me and FAIL unreduced one.
r11-1582 PASS x_1.i, x_2.i for me and PASS unreduced.

Thanks

[Bug tree-optimization/95761] [11 regression] ICE during GIMPLE pass: slp verify_ssa failed

2020-06-22 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95761

--- Comment #6 from Dmitry G. Dyachenko  ---
r11-1582 PASS for me x_2.i and original (non-reduced) compilation

[Bug tree-optimization/95761] [11 regression] ICE during GIMPLE pass: slp verify_ssa failed

2020-06-19 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95761

--- Comment #5 from Dmitry G. Dyachenko  ---
r11-1553 PASS original testcase for me.
And FAIL similar test with the same stack.

$ cat x_2.i
typedef int a[10];
typedef struct {
  a b;
  a c;
  a d;
} e;
e j;
void k() {
  int *h = j.c, *f = j.d, *g = j.b;
  int i;
  for (i = 0; i < 10; i++)
h[i] = f[0] + g[0];
  {
h = j.d;
for (i = 0; i < 10; i++)
  h[i] = f[1] - g[0];
h = 0;
h[0] = 0;
  }
  k();
}

gcc -O3 -fpreprocessed -c x_2.i 
x_2.i: In function 'k':
x_2.i:8:6: error: definition in block 2 follows the use
8 | void k() {
  |  ^
for SSA_NAME: vect_cst__14 in statement:
vect__31.16_9 = vect_cst__14 - vect__127.14_155;
during GIMPLE pass: slp
x_2.i:8:6: internal compiler error: verify_ssa failed
0x12407cd verify_ssa(bool, bool)
/home/dimhen/src/gcc_current/gcc/tree-ssa.c:1208
0xf385b5 execute_function_todo
/home/dimhen/src/gcc_current/gcc/passes.c:1992
0xf392ec do_per_function
/home/dimhen/src/gcc_current/gcc/passes.c:1640
0xf392ec execute_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2039
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


test from PR95770 FAIL too for me

[Bug tree-optimization/95761] New: [11 regression] ICE during GIMPLE pass: slp verify_ssa failed

2020-06-19 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95761

Bug ID: 95761
   Summary: [11 regression] ICE during GIMPLE pass: slp verify_ssa
failed
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r11-1451 PASS
r11-1512 FAIL

`gcc -O2' PASS

$ gcc -O3 -c x_1.i
x_1.i: In function 'k':
x_1.i:10:6: error: definition in block 3 follows the use
   10 | void k() {
  |  ^
for SSA_NAME: vect__2.17_23 in statement:
vect__124.21_25 = vect_cst__58 + vect__2.17_23;
during GIMPLE pass: slp
x_1.i:10:6: internal compiler error: verify_ssa failed
0x123ff3d verify_ssa(bool, bool)
/home/dimhen/src/gcc_current/gcc/tree-ssa.c:1208
0xf37d25 execute_function_todo
/home/dimhen/src/gcc_current/gcc/passes.c:1992
0xf38a5c do_per_function
/home/dimhen/src/gcc_current/gcc/passes.c:1640
0xf38a5c execute_todo
/home/dimhen/src/gcc_current/gcc/passes.c:2039
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat x_1.i
typedef int a[10];
typedef struct {
  a b;
  a c;
  a d;
  a e;
} f;
f g;
int *j;
void k() {
  for (;;) {
a l;
j[0] = g.b[0];
int *h = g.d;
int i = 0;
for (; i < 10; i++)
  h[i] = l[0] - g.e[0];
h = g.e;
i = 0;
for (; i < 10; i++)
  h[i] = l[1] + g.e[i];
  }
}

Sorry for hyper-reduction

[Bug c++/95223] [11 regression] hash table checking failed: equal operator returns true for a pair of values with a different hash value

2020-05-20 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95223

--- Comment #9 from Dmitry G. Dyachenko  ---
(In reply to Patrick Palka from comment #8)
> Thanks for the reports.  This should now hopefully be fixed with r11-522.

r11-526 PASS for me.
Thanks

[Bug libstdc++/95223] New: [11 regression] hash table checking failed: equal operator returns true for a pair of values with a different hash value

2020-05-19 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95223

Bug ID: 95223
   Summary: [11 regression] hash table checking failed: equal
operator returns true for a pair of values with a
different hash value
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r11-459 PASS
r11-495 FAIL

$ cat x.cpp
struct s { } a;
struct b;
#include 
#include 

$ g++ -std=c++98 x.cpp
hash table checking failed: equal operator returns true for a pair of values
with a different hash value
In file included from
/home/dimhen/arch-gcc/gcc_current/include/c++/11.0.0/map:60,
 from x.cpp:4:
/home/dimhen/arch-gcc/gcc_current/include/c++/11.0.0/bits/stl_tree.h:2149:37:
internal compiler error: in hashtab_chk_error, at hash-table.c:137
 2149 | _M_insert_unique(const _Val& __v)
  | ^
0xab76f2 hashtab_chk_error()
/home/dimhen/src/gcc_current/gcc/hash-table.c:137
0xc7b73d hash_table::verify(spec_entry*
const&, unsigned int)
/home/dimhen/src/gcc_current/gcc/hash-table.h:1033
0xc7b889 hash_table::find_with_hash(spec_entry* const&, unsigned int)
/home/dimhen/src/gcc_current/gcc/hash-table.h:934
0xc62f0d lookup_template_class_1
/home/dimhen/src/gcc_current/gcc/cp/pt.c:9776
0xc65213 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/home/dimhen/src/gcc_current/gcc/cp/pt.c:10115
0xc65213 tsubst_aggr_type
/home/dimhen/src/gcc_current/gcc/cp/pt.c:13369
0xc5f7f1 maybe_update_decl_type(tree_node*, tree_node*)
/home/dimhen/src/gcc_current/gcc/cp/pt.c:4858
0xc18263 cp_parser_init_declarator
/home/dimhen/src/gcc_current/gcc/cp/parser.c:20595
0xc1f8d4 cp_parser_single_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:29490
0xc1fa4b cp_parser_template_declaration_after_parameters
/home/dimhen/src/gcc_current/gcc/cp/parser.c:29062
0xc201a0 cp_parser_explicit_template_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:29328
0xc231e9 cp_parser_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13388
0xc22dd2 cp_parser_toplevel_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13467
0xc22dd2 cp_parser_declaration_seq_opt
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13315
0xc22dd2 cp_parser_namespace_body
/home/dimhen/src/gcc_current/gcc/cp/parser.c:19723
0xc22dd2 cp_parser_namespace_definition
/home/dimhen/src/gcc_current/gcc/cp/parser.c:19701
0xc231d8 cp_parser_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13419
0xc2381a cp_parser_translation_unit
/home/dimhen/src/gcc_current/gcc/cp/parser.c:4725
0xc2381a c_parse_file()
/home/dimhen/src/gcc_current/gcc/cp/parser.c:43976
0xd384ab c_common_parse_file()
/home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug bootstrap/94961] [11 Regression] ICE in df_refs_verify, at df-scan.c:4002 since r11-87-gd44f14ccef831d90feb57fab56bc3389d543ffdd

2020-05-08 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94961

--- Comment #7 from Dmitry G. Dyachenko  ---
r11-196 PASS for me.
Thanks.

[Bug bootstrap/94961] New: [11 regression] internal compiler error: in df_refs_verify, at df-scan.c:4002

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

Bug ID: 94961
   Summary: [11 regression] internal compiler error: in
df_refs_verify, at df-scan.c:4002
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r11-46 PASS
r11-117 FAIL

configure --enable-checking=yes,df --enable-languages=c,c++,lto
--disable-multilib

make
...
/home/dimhen/build/gcc_current/./prev-gcc/xg++
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/dimhen/src/gcc_current/libstdc++-v3/libsupc++
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-fno-PIE -c   -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I.
-I/home/dimhen/src/gcc_current/gcc -I/home/dimhen/src/gcc_current/gcc/.
-I/home/dimhen/src/gcc_current/gcc/../include
-I/home/dimhen/src/gcc_current/gcc/../libcpp/include
-I/home/dimhen/build/gcc_current/./gmp -I/home/dimhen/src/gcc_current/gmp
-I/home/dimhen/build/gcc_current/./mpfr/src
-I/home/dimhen/src/gcc_current/mpfr/src -I/home/dimhen/src/gcc_current/mpc/src 
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber/bid -I../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libbacktrace
-I/home/dimhen/build/gcc_current/./isl/include
-I/home/dimhen/src/gcc_current/isl/include  -o tree-ssa-loop-ivopts.o -MT
tree-ssa-loop-ivopts.o -MMD -MP -MF ./.deps/tree-ssa-loop-ivopts.TPo
/home/dimhen/src/gcc_current/gcc/tree-ssa-loop-ivopts.c
during RTL pass: jump2
/home/dimhen/src/gcc_current/gcc/tree-ssa-ccp.c: In function 'void
bit_value_unop(tree_code, signop, int, widest_int*, widest_int*, signop, int,
const widest_int&, const widest_int&)':
/home/dimhen/src/gcc_current/gcc/tree-ssa-ccp.c:1338:1: internal compiler
error: in df_refs_verify, at df-scan.c:4002
 1338 | }
  | ^
0xf1eb1d df_refs_verify
/home/dimhen/src/gcc_current/gcc/df-scan.c:4002
0xf1ed50 df_insn_refs_verify
/home/dimhen/src/gcc_current/gcc/df-scan.c:4072
0xf1eec4 df_bb_verify
/home/dimhen/src/gcc_current/gcc/df-scan.c:4101
0xf1f46e df_scan_verify()
/home/dimhen/src/gcc_current/gcc/df-scan.c:4222
0xf07083 df_verify()
/home/dimhen/src/gcc_current/gcc/df-core.c:1818
0xf0593f df_analyze_1
/home/dimhen/src/gcc_current/gcc/df-core.c:1214
0xf05d02 df_analyze()
/home/dimhen/src/gcc_current/gcc/df-core.c:1290
0x23a9d46 try_optimize_cfg
/home/dimhen/src/gcc_current/gcc/cfgcleanup.c:2994
0x23aa1cf cleanup_cfg(int)
/home/dimhen/src/gcc_current/gcc/cfgcleanup.c:3174
0x23aa506 execute
/home/dimhen/src/gcc_current/gcc/cfgcleanup.c:3354
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[3]: *** [Makefile:1117: tree-ssa-ccp.o] Error 1

[Bug tree-optimization/15348] [tree-ssa] Convert (x < 0) || (y < 0) into (x | y) < 0.

2020-03-11 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15348

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #4 from Dmitry G. Dyachenko  ---
x86_64 r10-7080 for me produce identical code
-- c#0 with -O2
-- c#1 with -O

[Bug c/93894] -Wimplicit-fallthrough false warning with operator %

2020-02-23 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93894

--- Comment #2 from Dmitry G. Dyachenko  ---
`unsigned' changes nothing

$ cat xxu.i 
int f1(int j, unsigned k)
{
switch (j) {
case 0:
switch (k % 2) {
case 0:
return 0;
case 1:
return 1;
}
// return 3; // uncomment to fix warning
default:
return 2;
}
}

$ gcc -fpreprocessed -Wimplicit-fallthrough=2 -Og -c xxu.i 
xx.i: In function ‘f1’:
xx.i:5:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
5 |  switch (k % 2) {
  |  ^~
xx.i:12:5: note: here
   12 | default:
  | ^~~

[Bug c/93894] New: -Wimplicit-fallthrough false warning with operator %

2020-02-23 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93894

Bug ID: 93894
   Summary: -Wimplicit-fallthrough false warning with operator %
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

SVN:r257061 8.0.1 20180125 FAIL
r10-6795 FAIL

$ cat xx.i
int f(int j, int k)
{
switch (j) {
case 0:
switch (k % 2) {
case 0:
return 0;
case 1:
return 1;
}
// return 3; // uncomment to fix warning
default:
return 2;
}
}

$ gcc -fpreprocessed -Wimplicit-fallthrough=2 -O[0123] -c xx.i
xx.i: In function ‘f’:
xx.i:5:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
5 |  switch (k % 2) {
  |  ^~
xx.i:12:5: note: here
   12 | default:
  | ^~~

[Bug tree-optimization/93845] [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2358

2020-02-20 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93845

--- Comment #1 from Dmitry G. Dyachenko  ---
'-Wall -Wextra -O3' free variant

$ cat x.ii
struct g;
struct h {
  g *operator->();
};
class i {
  void *a;
  int b;

public:
  template  f j() { return *static_cast(this); }
};
struct k : i {};
struct l : k {};
struct m {
  i n();
  i o(l, l, int);
};
struct g {
  void m_fn4(k);
};
h a;
i b;
i m::n() {
  l c, d, e = o(d, c, 0).j();
  a->m_fn4(e);
  return b;
}

$ ~/arch-gcc/r10-6309/bin/g++ -fpreprocessed -fchecking=1 -O3 -Wall -Wextra -c
x.ii

$ $ ~/arch-gcc/r10-6723/bin/g++ -fpreprocessed -fchecking=1 -O -c x.ii
during GIMPLE pass: esra
x.ii: In member function ‘i m::n()’:
x.ii:27:1: internal compiler error: in verify_sra_access_forest, at
tree-sra.c:2358
   27 | }
  | ^
0x817afd verify_sra_access_forest(access*)
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2358
0x1334bca verify_all_sra_access_forests()
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2403
0x1339910 analyze_all_variable_accesses
/home/dimhen/src/gcc_current/gcc/tree-sra.c:3414
0x1339e31 perform_intra_sra
/home/dimhen/src/gcc_current/gcc/tree-sra.c:4468
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/93845] New: [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2358

2020-02-20 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93845

Bug ID: 93845
   Summary: [10 regression] ICE in verify_sra_access_forest, at
tree-sra.c:2358
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

probably differs from PR93776 and PR93516

r10-6309 PASS
r10-6342 FAIL
r10-6723 FAIL

[r10-6723] g++ -fpreprocessed -fchecking=1 -O -c x.ii
g++  -fpreprocessed -fchecking=1 -O -c x.ii; ll x.ii
during GIMPLE pass: esra
x.ii: In function ‘void m()’:
x.ii:21:1: internal compiler error: in verify_sra_access_forest, at
tree-sra.c:2358
   21 | }
  | ^
0x817afd verify_sra_access_forest(access*)
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2358
0x1334bca verify_all_sra_access_forests()
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2403
0x1339910 analyze_all_variable_accesses
/home/dimhen/src/gcc_current/gcc/tree-sra.c:3414
0x1339e31 perform_intra_sra
/home/dimhen/src/gcc_current/gcc/tree-sra.c:4468
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat x.ii
struct a;
struct b {
  a *operator->();
};
class c {
  void *g;
  int d;

public:
  template  e f() { return *static_cast(this); }
};
struct h : c {};
struct a {
  void i(c);
};
void m() {
  b j;
  c k;
  h l = k.f();
  j->i(l);
}

[Bug c++/93785] New: g++ crash/hang on invalid template

2020-02-17 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93785

Bug ID: 93785
   Summary: g++ crash/hang on invalid template
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r257061 FAIL -- SVN/gcc version 8.0.1 20180125
r10-6659 FAIL

$ cat x.ii
template  struct b {
  struct c;
  b d
} using e = b;
e f;

$ ~/arch-gcc/gcc_current/bin/g++ -fpreprocessed -fchecking=0 -O0 -c x.ii
x.ii:3:8: error: expected ‘;’ at end of member declaration
3 |   b d
  |^
  | ;
x.ii:4:2: error: expected ‘;’ after struct definition
4 | } using e = b;
  |  ^
  |  ;
^C

run indefinitely, then killed by OOM-killer.

[Bug tree-optimization/93516] New: [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2342

2020-01-30 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93516

Bug ID: 93516
   Summary: [10 regression] ICE in verify_sra_access_forest, at
tree-sra.c:2342
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r10-6309 PASS
r10-6342 FAIL

$ cat x.ii
struct b;
struct c {
  b *operator->();
};
class e {
  void *f;
  int d;

public:
  template  a g() { return *static_cast(this); }
};
struct h : e {};
struct b {
  void i(e);
  e j();
};
void m() {
  c k;
  h l = k->j().g();
  k->i(l);
}

$ g++ -fpreprocessed -fchecking=1 -O  -c x.ii
during GIMPLE pass: esra
x.ii: In function 'void m()':
x.ii:21:1: internal compiler error: in verify_sra_access_forest, at
tree-sra.c:2342
   21 | }
  | ^
0x816180 verify_sra_access_forest(access*)
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2342
0x132d031 verify_all_sra_access_forests()
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2387
0x13319cf analyze_all_variable_accesses
/home/dimhen/src/gcc_current/gcc/tree-sra.c:3381
0x1331eff perform_intra_sra
/home/dimhen/src/gcc_current/gcc/tree-sra.c:4432
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c++/93477] [10 Regression] __atribute__((weak)) variables sharing the same name in two named namespaces cause a multiple definition error

2020-01-29 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93477

--- Comment #6 from Dmitry G. Dyachenko  ---
r10-6310 PASS for me both reduced and unreduced cases.

Thanks

[Bug c++/93477] New: [10 Regression] __atribute__((weak)) variables sharing the same name in two named namespaces cause a multiple definition error

2020-01-28 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93477

Bug ID: 93477
   Summary: [10 Regression] __atribute__((weak)) variables sharing
the same name in two named namespaces cause a multiple
definition error
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r10-6101 PASS
r10-6221 FAIL

PASS with anonymous namespace.

May be start at r10-6110?

$ cat x.cc
namespace x {
  struct s {
s() {}
static int a;
  };
  struct s __attribute__((weak)) b = {};
};

$ g++ -fpic -DPIC x.cc -c -o x.o
$ g++ -fpic -DPIC x.cc -c -o y.o
$ g++ -shared x.o y.o -o z.so
ld: y.o:(.bss+0x8): multiple definition of `guard variable for x::b';
x.o:(.bss+0x8): first defined here
collect2: error: ld returned 1 exit status


Fedora 31 x86_64

[Bug c++/92169] crash on referring to a local class member by unqualified name from outside the enclosing function

2020-01-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92169

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #1 from Dmitry G. Dyachenko  ---
r257061 PASS for me
r10-6221-g53d172975f269138ba227f6d4560950265c36df8 PASS too

g++ -std=c++{14,17,2a} -fchecking=2 -Ofast -c x.cc

[Bug ipa/92240] [10 regression] ICE in duplicate, at ipa-prop.c:3883

2020-01-14 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

--- Comment #9 from Dmitry G. Dyachenko  ---
Created attachment 47654
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47654=edit
pre-processed isl_fold.c

gcc_r277495
./contrib/download_prerequisites
~/src/gcc_r277485/configure --enable-checking=yes --enable-languages=c,c++
--disable-multilib --with-isl

make

[...]

libtool: compile:  /home/dimhen/build/./prev-gcc/xgcc
-B/home/dimhen/build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/
-isystem /usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -fno-checking -DHAVE_CONFIG_H -I.
-I/home/dimhen/src/gcc_r277485/isl -I/home/dimhen/src/gcc_r277485/isl/include
-Iinclude/ -I/home/dimhen/src/gcc_r277485/gmp -I/home/dimhen/build/./gmp -g -O2
-fno-checking -gtoggle -MT isl_fold.lo -MD -MP -MF .deps/isl_fold.Tpo -c
/home/dimhen/src/gcc_r277485/isl/isl_fold.c -o isl_fold.o
during IPA pass: inline
/home/dimhen/src/gcc_r277485/isl/isl_fold.c:1777:1: internal compiler error: in
duplicate, at ipa-prop.c:3883
 1777 | }
  | ^
0xe820f8 ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*,
ipa_edge_args*, ipa_edge_args*)
/home/dimhen/src/gcc_r277485/gcc/ipa-prop.c:3883
0xe8a7df call_summary::symtab_duplication(cgraph_edge*,
cgraph_edge*, void*)
/home/dimhen/src/gcc_r277485/gcc/symbol-summary.h:771
0xae6b11 symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
/home/dimhen/src/gcc_r277485/gcc/cgraph.c:453
0xb04f3f cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count,
profile_count, bool)
/home/dimhen/src/gcc_r277485/gcc/cgraphclones.c:141
0xb05f80 cgraph_node::create_clone(tree_node*, profile_count, bool,
vec, bool, cgraph_node*, ipa_param_adjustments*,
char const*)
/home/dimhen/src/gcc_r277485/gcc/cgraphclones.c:390
0x2060f11 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_r277485/gcc/ipa-inline-transform.c:217
0x2060fc6 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_r277485/gcc/ipa-inline-transform.c:236
0x2060fc6 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_r277485/gcc/ipa-inline-transform.c:236
0x2061c4b inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_r277485/gcc/ipa-inline-transform.c:479
0x2052e40 inline_small_functions
/home/dimhen/src/gcc_r277485/gcc/ipa-inline.c:2151
0x20548e9 ipa_inline
/home/dimhen/src/gcc_r277485/gcc/ipa-inline.c:2615
0x205578e execute
/home/dimhen/src/gcc_r277485/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.


/home/dimhen/build/./prev-gcc/xgcc -B/home/dimhen/build/./prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -fno-checking -DHAVE_CONFIG_H -I.
-I/home/dimhen/src/gcc_r277485/isl -I/home/dimhen/src/gcc_r277485/isl/include
-Iinclude/ -I/home/dimhen/src/gcc_r277485/gmp -I/home/dimhen/build/./gmp -g -O2
-fno-checking -gtoggle -MT isl_fold.lo -MD -MP -MF .deps/isl_fold.Tpo -c
/home/dimhen/src/gcc_r277485/isl/isl_fold.c -o isl_fold.i -E

/home/dimhen/build/./prev-gcc/xgcc -fpreprocessed
-B/home/dimhen/build/./prev-gcc/ -fno-checking -g -O2 -fno-checking -gtoggle -c
isl_fold.i

[Bug ipa/92240] [10 regression] ICE in duplicate, at ipa-prop.c:3883

2020-01-14 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

--- Comment #10 from Dmitry G. Dyachenko  ---
(In reply to Martin Liška from comment #6)
> @Dmitry: Can you please attach a pre-processed source file (-E option)?

done

[Bug ipa/92240] [10 regression] ICE in duplicate, at ipa-prop.c:3883

2020-01-14 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

--- Comment #7 from Dmitry G. Dyachenko  ---
(In reply to Martin Liška from comment #6)
> @Dmitry: Can you please attach a pre-processed source file (-E option)?

@Martin: FAIL start for me during gcc bootstrap somewhere between r277460 and
r277485. bootstrap was restored for me at r277486.

Fedora 31, x86_64

For reproduce you can try download gcc sources, run
contrib/download_prerequesites, run configure as c#1 and make.

I"ll download preprocessed file tomorrow.

[Bug bootstrap/93074] [10 regression] build FAIL with --enable-offload-targets=nvptx-none

2019-12-26 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93074

--- Comment #2 from Dmitry G. Dyachenko  ---
(In reply to Andrew Pinski from comment #1)
> According to
> https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__DEVICE.html
> 
> cuDeviceGetName exists.
> Maybe F31 has an older version of Cuda installed.

I have no CUDA installed.
Can I check smth else?

r279710 FAIL
r279709 PASS

[Bug bootstrap/93074] New: [10 regression] build FAIL with --enable-offload-targets=nvptx-none

2019-12-25 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93074

Bug ID: 93074
   Summary: [10 regression] build FAIL with
--enable-offload-targets=nvptx-none
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r279700 PASS
r279735 FAIL

Fedora 31 x86_64

configure --disable-multilib --enable-offload-targets=nvptx-none

make
[...]
libtool: compile:  /home/dimhen/build/gcc_current/./gcc/xgcc
-B/home/dimhen/build/gcc_current/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -fno-checking -DHAVE_CONFIG_H -I.
-I/home/dimhen/src/gcc_current/libgomp
-I/home/dimhen/src/gcc_current/libgomp/config/linux/x86
-I/home/dimhen/src/gcc_current/libgomp/config/linux
-I/home/dimhen/src/gcc_current/libgomp/config/posix
-I/home/dimhen/src/gcc_current/libgomp
-I/home/dimhen/src/gcc_current/libgomp/../include
-I/home/dimhen/src/gcc_current/libgomp/plugin/cuda -Wall -Werror
-ftls-model=initial-exec -pthread -DUSING_INITIAL_EXEC_TLS -g -O2 -MT
libgomp_plugin_nvptx_la-plugin-nvptx.lo -MD -MP -MF
.deps/libgomp_plugin_nvptx_la-plugin-nvptx.Tpo -c
/home/dimhen/src/gcc_current/libgomp/plugin/plugin-nvptx.c  -fPIC -DPIC -o
.libs/libgomp_plugin_nvptx_la-plugin-nvptx.o
/home/dimhen/src/gcc_current/libgomp/plugin/cuda-lib.def:11:16: error:
‘cuDeviceGetName’ undeclared here (not in a function); did you mean
‘cuDeviceGet’?
   11 | CUDA_ONE_CALL (cuDeviceGetName)

[Bug c++/39751] ICE in cp_lexer_new_from_tokens, at cp/parser.c:342

2019-12-04 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39751

--- Comment #11 from Dmitry G. Dyachenko  ---
Original test case from c#0 crash in trunk
gcc version 10.0.0 20191204 (experimental) [trunk revision 278972] (GCC)

$ g++ -fpreprocessed -fsyntax-only a.ii 
a.ii:5:1: error: types may not be defined in template arguments
5 | {
  | ^
a.ii:6:1: error: ISO C++ forbids declaration of ‘f’ with no type [-fpermissive]
6 | f () :
  | ^
a.ii:6:6: error: expected ‘}’ at end of input
6 | f () :
  |  ^
a.ii:5:1: note: to match this ‘{’
5 | {
  | ^
a.ii:6:6: error: expected template-argument at end of input
6 | f () :
  |  ^
a.ii:6:6: error: expected ‘>’ at end of input
a.ii:4:1: error: expected unqualified-id at end of input
4 | A < struct
  | ^~
5 | {
  | ~
6 | f () :
  | ~~
a.ii:4:1: error: expected ‘}’ at end of input
a.ii:3:1: note: to match this ‘{’
3 | {
  | ^
a.ii:4:1: internal compiler error: in cp_lexer_new_from_tokens, at
cp/parser.c:698
4 | A < struct
  | ^~
5 | {
  | ~
6 | f () :
  | ~~
0x6541ef cp_parser_push_lexer_for_tokens
/home/dimhen/src/gcc_current/gcc/cp/parser.c:698
0xbb3005 cp_parser_late_parsing_for_member
/home/dimhen/src/gcc_current/gcc/cp/parser.c:29559
0xb91ee7 cp_parser_class_specifier_1
/home/dimhen/src/gcc_current/gcc/cp/parser.c:23942
0xb92e83 cp_parser_class_specifier
/home/dimhen/src/gcc_current/gcc/cp/parser.c:23966
0xb92e83 cp_parser_type_specifier
/home/dimhen/src/gcc_current/gcc/cp/parser.c:17576
0xb93f0f cp_parser_decl_specifier_seq
/home/dimhen/src/gcc_current/gcc/cp/parser.c:14249
0xbb95a5 cp_parser_single_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:29075
0xbb992b cp_parser_template_declaration_after_parameters
/home/dimhen/src/gcc_current/gcc/cp/parser.c:28738
0xbba080 cp_parser_explicit_template_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:29004
0xbbd3e9 cp_parser_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13271
0xbbda0a cp_parser_translation_unit
/home/dimhen/src/gcc_current/gcc/cp/parser.c:4721
0xbbda0a c_parse_file()
/home/dimhen/src/gcc_current/gcc/cp/parser.c:43048
0xccf60b c_common_parse_file()
/home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1185
Please submit a full bug report,

[Bug ipa/92809] New: [10 regression] error: calls_comdat_local is set outside of a comdat group

2019-12-04 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92809

Bug ID: 92809
   Summary: [10 regression] error: calls_comdat_local is set
outside of a comdat group
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

r278936 PASS
r278958 FAIL

Maybe dup PR86905?

$ $ cat x.ii
struct a {
  int operator!=(a);
};
template  struct c : a {
  b operator*();
  void operator++();
};
template  struct e {
  using f = c;
  f begin();
  f end();
};
struct g {
  virtual void anchor();
};
struct h {
  e i;
  virtual void j(int &);
  void k();
};
struct l : g, h {
  void j(int &) {}
};
void h::k() {
  for (auto m : i)
j(*m);
}

$ g++ -fpreprocessed -O2 -std=c++11 -fchecking=1 -c x.ii
x.ii:27:1: error: calls_comdat_local is set outside of a comdat group
   27 | }
  | ^
_ZThn8_N1l1jERi/2 (virtual void l::_ZThn8_N1l1jERi(int&)) @0x7f578fca12d0
  Type: function
  Body removed by symtab_remove_unreachable_nodes
  Visibility: externally_visible public weak comdat comdat_group:_ZN1l1jERi
one_only section:.text._ZN1l1jERi (implicit_section) virtual artificial
  References: 
  Referring: 
  Availability: not_available
  Function flags: calls_comdat_local indirect_call_target
  Former thunk fixed offset -8 virtual value 0 indirect_offset 0 has virtual
offset 0
  Called by: 
  Calls: 
during IPA pass: inline
x.ii:27:1: internal compiler error: verify_cgraph_node failed
0xd7a956 cgraph_node::verify_node()
/home/dimhen/src/gcc_current/gcc/cgraph.c:3444
0xd6ea94 symtab_node::verify()
/home/dimhen/src/gcc_current/gcc/symtab.c:1279
0xd6fbbe symtab_node::verify_symtab_nodes()
/home/dimhen/src/gcc_current/gcc/symtab.c:1299
0xff0290 symtab_node::checking_verify_symtab_nodes()
/home/dimhen/src/gcc_current/gcc/cgraph.h:650
0xff0290 symbol_table::remove_unreachable_nodes(_IO_FILE*)
/home/dimhen/src/gcc_current/gcc/ipa.c:672
0x1b893f6 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2695
0x1b893f6 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3088
Please submit a full bug report,

g++ -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20191204 (experimental) [trunk revision 278958] (GCC)

[Bug middle-end/91195] [10 regression] incorrect may be used uninitialized smw (272711, 273474]

2019-11-20 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91195

--- Comment #11 from Dmitry G. Dyachenko  ---
r278496 fix my original problem.
Thank you

[Bug bootstrap/92314] [10 regression] missing omp-device-properties', needed by 's-omp-device-properties-h'

2019-11-01 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92314

--- Comment #4 from Dmitry G. Dyachenko  ---
Thank for clarification.
Sorry for noise

[Bug bootstrap/92314] [10 regression] missing omp-device-properties', needed by 's-omp-device-properties-h'

2019-11-01 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92314

--- Comment #2 from Dmitry G. Dyachenko  ---
I use system compiler for bootstrap: gcc9/Fedora31

Did I understood you correctly: I need offloading compiler installed after
r277662 if I say '--enable-offload-targets=nvptx-none' ?

so invalid PR?

[Bug bootstrap/92314] New: [10 regression] missing omp-device-properties', needed by 's-omp-device-properties-h'

2019-11-01 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92314

Bug ID: 92314
   Summary: [10 regression] missing omp-device-properties', needed
by 's-omp-device-properties-h'
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r277655 PASS
r277686 FAIL

sounds like stage 1 issue?

configure --prefix=/usr/local/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native

make -j4
...
make[3]: Entering directory '/home/dimhen/build/gcc_current/gcc'
make[3]: *** No rule to make target
'/usr/local/gcc_current/lib/gcc/x86_64-pc-linux-gnu/10.0.0/accel/nvptx-none/omp-device-properties',
needed by 's-omp-device-properties-h'.  Stop.

[Bug ipa/92254] [10 regression] ICE LTO in inline_small_functions, at ipa-inline.c:2000

2019-10-31 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92254

--- Comment #6 from Dmitry G. Dyachenko  ---
r277655 PASS for me: testcase and original case.
Thank You

[Bug ipa/92254] [10 regression] ICE LTO in inline_small_functions, at ipa-inline.c:2000

2019-10-30 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92254

--- Comment #5 from Dmitry G. Dyachenko  ---
very strange
r277625 FAIL for me for testcase from c#1 and for original problem

[Bug ipa/92278] [10 regression] LTO ICE ipa_get_ith_polymorhic_call_context ipa-prop.h:616

2019-10-30 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92278

--- Comment #8 from Dmitry G. Dyachenko  ---
r277625 PASS for me for testcase from c#0 and for original problem.
Thank you

[Bug ipa/92278] New: [10 regression] LTO ICE ipa_get_ith_polymorhic_call_context ipa-prop.h:616

2019-10-30 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92278

Bug ID: 92278
   Summary: [10 regression] LTO ICE
ipa_get_ith_polymorhic_call_context ipa-prop.h:616
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

r277460 PASS
r277486 FAIL as PR92242
r277504 FAIL
r277576 FAIL

$ cat a.i
typedef enum a b;
unsigned f2(b *, int);

void f1(void* i, void* j) {
  (void) i;
  (void) j;
  f2(0, 0);
}

$ cat b.i
typedef unsigned (*c)(void *, void *);
typedef struct {
  c d;
} e;

unsigned f1(void *, void *);
static const e f[] = {{f1}};

const e *foo() { return f; }

$ cat c.i
int g(int, int, int, unsigned char *, int);
void a(void *, void *);

typedef struct {
  int b;
} c;
typedef struct {
  c d;
} e;

static int h(unsigned char *i, int j, int *k, int l) {
  int ae = j;
  j = ae;
  g(0, 0, 0, i, 0);
  if (l)
a(k, 0);
  return 0;
}
static int am(void) { return 0; }
static int ar(c *i) {
  int as = i->b;
  h(0, as, 0, 0);
  return 0;
}
unsigned f2(e *i, int j) {
  (void) j;
  am();
  ar(>d);
  return 0;
}

$ cat x.ver
{ global:
foo;
local: *; };

$ gcc -fpreprocessed -O2 -flto -c a.i b.i c.i

$ gcc -flto -fPIC -DPIC -shared a.o b.o c.o -Wl,-version-script -Wl,x.ver -o
libx.so
during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0xdd458f crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0xbef32b ipa_get_ith_polymorhic_call_context
/home/dimhen/src/gcc_current/gcc/ipa-prop.h:616
0xbef32b update_jump_functions_after_inlining
/home/dimhen/src/gcc_current/gcc/ipa-prop.c:2671
0xbf00e3 propagate_info_to_inlined_callees
/home/dimhen/src/gcc_current/gcc/ipa-prop.c:3555
0x16f7a8c inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:488
0x16f13b2 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x16f13b2 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x16f13b2 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/local/binutils_current/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

[Bug ipa/92254] [10 regression] ICE LTO in inline_small_functions, at ipa-inline.c:2000

2019-10-29 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92254

--- Comment #1 from Dmitry G. Dyachenko  ---
$ cat a.i
typedef unsigned (*c)(void *, void *);
typedef struct {
  c d;
} e;

unsigned bar(void *, void *);
unsigned baz(void *, void *);
static const e f[] = {{bar}, {baz}};

const e *foo() {
return f;
}

$ cat b.i
unsigned f1(int *, unsigned short);
unsigned baz(void *c, void *d) {
  int *a = c;
  (void)d;
  if (!c)
return 1;
  return f1(a, 0);
}

$ cat c.i
unsigned f1(int *, unsigned short);
unsigned bar(void *c, void *d) {
  int *a = c;
  (void)d;
  if (!c)
return 1;
  return f1(a, 0);
}

$ cat d.i
int b, c;
int a(int *);

unsigned f1(int *d, unsigned short e) {
  b = 0;
  if (e) {
a(d);
if (c)
  return 0;
  }
  return a(d);
}

$ cat x.ver
{ global:
foo;
local: *; };

$ gcc -fpreprocessed -O2 -flto -c a.i b.i c.i d.i

$ gcc -flto -fPIC -DPIC -shared a.o b.o c.o d.o -Wl,-version-script
-Wl,/home/dimhen/errs/gcc10/PR92254/x.ver -o libso.so
during IPA pass: inline
lto1: internal compiler error: in inline_small_functions, at ipa-inline.c:2000
0x900b07 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2000
0x900b07 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x900b07 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
lto-wrapper: fatal error: /home/dimhen/arch-gcc/gcc_277504/bin/gcc returned 1
exit status
compilation terminated.
/usr/local/binutils_current/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

[Bug ipa/92254] New: [10 regression] ICE LTO in inline_small_functions, at ipa-inline.c:2000

2019-10-28 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92254

Bug ID: 92254
   Summary: [10 regression] ICE LTO in inline_small_functions, at
ipa-inline.c:2000
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

r277460 PASS
r277504 FAIL

Fedora 31 x86_64

gcc -shared -fPIC -DPIC -flto [40+ files] -Wl,-version-script -Wl,ver.file -o
...

during IPA pass: inline
lto1: internal compiler error: in inline_small_functions, at ipa-inline.c:2000
0x900b07 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2000
0x900b07 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x900b07 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/local/binutils_current/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

[Bug ipa/92242] [10 regression] LTO ICE in ipa_get_cs_argument_count ipa-prop.h:598

2019-10-28 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92242

--- Comment #4 from Dmitry G. Dyachenko  ---
r277504 PASS for me.
Thank you

[Bug ipa/92251] [10 regression] SEGV in ipa_get_cs_argument_count

2019-10-28 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92251

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #1 from Dmitry G. Dyachenko  ---
PR92242 dup?

[Bug ipa/92240] [10 regression] ICE in duplicate, at ipa-prop.c:3883

2019-10-28 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

--- Comment #4 from Dmitry G. Dyachenko  ---
(In reply to Richard Biener from comment #3)
> Happends during in-tree build of ISL.  Did you do the setup with
> ./contrib/download_prerequesites?

Yes, I setup with ./contrib/download_prerequesites

ICE fixed in r277486

[Bug ipa/92242] [10 regression] LTO ICE in ipa_get_cs_argument_count ipa-prop.h:598

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92242

--- Comment #2 from Dmitry G. Dyachenko  ---
correctly reduced testcase

$ cat x.i
unsigned foo(int a) {
  if (a)
return 0;
  return 1;
}

$ cat y.i
unsigned foo(int);
int bar() {
  foo(0);
  return 0;
}

$ cat libso.ver
{ global:
bar;
local: *; };

$ gcc -O2 -flto -Wall -c x.i y.i

$ gcc -flto -fPIC -DPIC -shared x.o y.o -Wl,-version-script -Wl,./libso.ver -o
libso.so
during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0xdd4bdf crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0x64e28d ipa_get_cs_argument_count
/home/dimhen/src/gcc_current/gcc/ipa-prop.h:598
0x64e28d ipa_merge_fn_summary_after_inlining(cgraph_edge*)
/home/dimhen/src/gcc_current/gcc/ipa-fnsummary.c:3318
0x16f66db inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:484
0x16f0682 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x16f0682 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x16f0682 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
$ gcc -flto -fPIC -DPIC -shared x.o y.o -Wl,-version-script -Wl,./libso.ver -o
libso.so
during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0xdd4bdf crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0x64e28d ipa_get_cs_argument_count
/home/dimhen/src/gcc_current/gcc/ipa-prop.h:598
0x64e28d ipa_merge_fn_summary_after_inlining(cgraph_edge*)
/home/dimhen/src/gcc_current/gcc/ipa-fnsummary.c:3318
0x16f66db inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:484
0x16f0682 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x16f0682 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x16f0682 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug ipa/92242] [10 regression] LTO ICE in ipa_get_cs_argument_count ipa-prop.h:598

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92242

--- Comment #1 from Dmitry G. Dyachenko  ---
over reduced but still ICE

$ cat x.i
unsigned foo(int a)
{
  if (a)
return 0;
}

$ cat y.i
unsigned foo();
void bar() { foo(); }

$ cat libso.ver 
{ global:
bar;
local: *; };


$ gcc -O2 -flto -c x.i y.i
$ gcc -flto -fPIC -DPIC -shared x.o y.o -Wl,-version-script -Wl,./libso.ver -o
libso.so
during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0xdd4bdf crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0x64e28d ipa_get_cs_argument_count
/home/dimhen/src/gcc_current/gcc/ipa-prop.h:598
0x64e28d ipa_merge_fn_summary_after_inlining(cgraph_edge*)
/home/dimhen/src/gcc_current/gcc/ipa-fnsummary.c:3318
0x16f66db inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:484
0x16f0682 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x16f0682 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x16f0682 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/local/binutils_current/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

[Bug ipa/92242] New: [10 regression] LTO ICE in ipa_get_cs_argument_count ipa-prop.h:598

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92242

Bug ID: 92242
   Summary: [10 regression] LTO ICE in ipa_get_cs_argument_count
ipa-prop.h:598
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

r277460 PASS
r277486 FAIL

I'll try creduce it / proprietary codebase, 50+ files LTO linked into .so dylib

Fedora 31 x86_64

/home/dimhen/src/gcc_current/configure --prefix=/usr/local/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native

make dylib [LTO with high optimization]

during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0xdd4bdf crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0x64e28d ipa_get_cs_argument_count
/home/dimhen/src/gcc_current/gcc/ipa-prop.h:598
0x64e28d ipa_merge_fn_summary_after_inlining(cgraph_edge*)
/home/dimhen/src/gcc_current/gcc/ipa-fnsummary.c:3318
0x16f66db inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:484
0x16f0682 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x16f0682 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x16f0682 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.

[Bug c/92241] ice in vect_mark_pattern_st mts, at tree-vect-patterns.c:5175

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92241

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #1 from Dmitry G. Dyachenko  ---
r277434 PASS for me

$ ./gcc_277434/bin/gcc  -O3 -c x.i
x.i: In function ‘d’:
x.i:8:13: warning: iteration 2 invokes undefined behavior
[-Waggressive-loop-optimizations]
8 |   a &= c[b + e] && 1;
  |~^~~
x.i:7:5: note: within this loop
7 | for (; e <= 8; e++)
  | ^~~
$

[Bug bootstrap/92240] [10 regression] ICE in duplicate, at ipa-prop.c:3883

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #2 from Dmitry G. Dyachenko  ---
r277486 PASS for me

[Bug bootstrap/92240] [10 regression] ICE in duplicate, at ipa-prop.c:3883

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

--- Comment #1 from Dmitry G. Dyachenko  ---
simplified configure' call

configure --enable-checking=yes --enable-languages=c,c++ --disable-multilib
--with-isl

make

/home/dimhen/build/gcc_current/./prev-gcc/xgcc
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -fno-checking -DHAVE_CONFIG_H -I.
-I/home/dimhen/src/gcc_current/isl -I/home/dimhen/src/gcc_current/isl/include
-Iinclude/ -I/home/dimhen/src/gcc_current/gmp
-I/home/dimhen/build/gcc_current/./gmp -g -O2 -fno-checking -gtoggle -MT
isl_fold.lo -MD -MP -MF .deps/isl_fold.Tpo -c
/home/dimhen/src/gcc_current/isl/isl_fold.c -o isl_fold.o
during IPA pass: inline
/home/dimhen/src/gcc_current/isl/isl_fold.c:1777:1: internal compiler error: in
duplicate, at ipa-prop.c:3883
 1777 | }
  | ^
0xe820f8 ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*,
ipa_edge_args*, ipa_edge_args*)
/home/dimhen/src/gcc_current/gcc/ipa-prop.c:3883
0xe8a7df call_summary::symtab_duplication(cgraph_edge*,
cgraph_edge*, void*)
/home/dimhen/src/gcc_current/gcc/symbol-summary.h:771
0xae6b11 symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
/home/dimhen/src/gcc_current/gcc/cgraph.c:453
0xb04f3f cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count,
profile_count, bool)
/home/dimhen/src/gcc_current/gcc/cgraphclones.c:141
0xb05f80 cgraph_node::create_clone(tree_node*, profile_count, bool,
vec, bool, cgraph_node*, ipa_param_adjustments*,
char const*)
/home/dimhen/src/gcc_current/gcc/cgraphclones.c:390
0x2060f11 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:217
0x2060fc6 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:236
0x2060fc6 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:236
0x2061c4b inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:479
0x2052e40 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x20548e9 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x205578e execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug bootstrap/92240] New: [10 regression] ICE in duplicate, at ipa-prop.c:3883

2019-10-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92240

Bug ID: 92240
   Summary: [10 regression] ICE in duplicate, at ipa-prop.c:3883
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r277460 PASS
r277485 FAIL

gcc_current/configure --prefix=/usr/local/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native

make
...
/home/dimhen/build/gcc_current/./prev-gcc/xgcc
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/bin/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/bin/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/gcc_current/x86_64-pc-linux-gnu/include -isystem
/usr/local/gcc_current/x86_64-pc-linux-gnu/sys-include -fno-checking
-DHAVE_CONFIG_H -I. -I/home/dimhen/src/gcc_current/isl
-I/home/dimhen/src/gcc_current/isl/include -Iinclude/
-I/home/dimhen/src/gcc_current/gmp -I/home/dimhen/build/gcc_current/./gmp -g
-O2 -fno-checking -gtoggle -MT isl_fold.lo -MD -MP -MF .deps/isl_fold.Tpo -c
/home/dimhen/src/gcc_current/isl/isl_fold.c -o isl_fold.o
during IPA pass: inline
/home/dimhen/src/gcc_current/isl/isl_fold.c:1777:1: internal compiler error: in
duplicate, at ipa-prop.c:3883
 1777 | }
  | ^
0xeeab70 ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*,
ipa_edge_args*, ipa_edge_args*)
/home/dimhen/src/gcc_current/gcc/ipa-prop.c:3883
0xef3257 call_summary::symtab_duplication(cgraph_edge*,
cgraph_edge*, void*)
/home/dimhen/src/gcc_current/gcc/symbol-summary.h:771
0xafb841 symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
/home/dimhen/src/gcc_current/gcc/cgraph.c:453
0xb19c79 cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count,
profile_count, bool)
/home/dimhen/src/gcc_current/gcc/cgraphclones.c:141
0xb1acba cgraph_node::create_clone(tree_node*, profile_count, bool,
vec, bool, cgraph_node*, ipa_param_adjustments*,
char const*)
/home/dimhen/src/gcc_current/gcc/cgraphclones.c:390
0x26ccd59 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:217
0x26cce0e clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:236
0x26cce0e clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:236
0x26cda93 inline_call(cgraph_edge*, bool, vec*,
int*, bool, bool*)
/home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:479
0x26bec88 inline_small_functions
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x26c0731 ipa_inline
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x26c15d6 execute
/home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

[Bug c/92205] ice in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1688

2019-10-24 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92205

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #2 from Dmitry G. Dyachenko  ---
For me
r277307 PASS
r277341 FAIL

[Bug debug/91929] missing inline subroutine information in build using sin/cos

2019-10-21 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91929

--- Comment #14 from Dmitry G. Dyachenko  ---
(In reply to rguent...@suse.de from comment #13)
> On Fri, 18 Oct 2019, dimhen at gmail dot com wrote:
> I guess
> previously the uninit pass didn't emit warnings for the load
> because it had no location.

So new warnings are expected. Nice!
Thank you

[Bug debug/91929] missing inline subroutine information in build using sin/cos

2019-10-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91929

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #12 from Dmitry G. Dyachenko  ---
I see new warnings -Wuninitialized and -Wmaybe-uninitialized after r276993

r276992 no warnings
r276993 warnings

$ cat x_3.i
int *a;
int b, d;

int g() {
  int *c;
  int e[6];
  int f = 1;
  if (0)
goto cd;
  c = 0;
  for (; d; d++)
*e = 1 ^ *(c + 1);
  if (f)
for (b = 0;;)
  a[0] = e[b];
cd:
  return 0;
}

$ ~/arch-gcc/gcc_276993/bin/gcc -fpreprocessed -O2 -Wall -c x_3.i

x_3.i: In function ‘g’:
x_3.i:15:15: warning: ‘e[0]’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   15 |   a[0] = e[b];
  |  ~^~~


$ cat x.i
typedef struct {
  int a[0];
} c;
typedef struct {
  c d;
} * e;
e a;
void f(void);
void f() {
  int c[1];
  for (;;) {
unsigned long d[0];
int b, g, h = b = h;
unsigned long *e = d;
for (; g; ++g)
  e[g] = 0;
*a->d.a = *c;
  }
}

$ ~/arch-gcc/gcc_276993/bin/gcc -fpreprocessed -O2 -Wall -c x.i
x.i: In function ‘f’:
x.i:17:13: warning: ‘c[0]’ is used uninitialized in this function
[-Wuninitialized]
   17 | *a->d.a = *c;
  | ^~~~

[Bug c++/92070] [10 regression] -fchecking=2 error: taking address of rvalue

2019-10-12 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92070

--- Comment #6 from Dmitry G. Dyachenko  ---
(In reply to Marek Polacek from comment #5)
> Fixed.

r267903 FAIL and r267907 PASS for me with original problem -- LLVM-current
build

Thanks

[Bug c++/92070] [10 regression] -fchecking=2 error: taking address of rvalue

2019-10-11 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92070

--- Comment #2 from Dmitry G. Dyachenko  ---
(In reply to Marek Polacek from comment #1)
> Will be fixed by my patch
> https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00782.html
> but the testcase is useful.

dup PR92049?

[Bug c++/92070] New: [10 regression] -fchecking=2 error: taking address of rvalue

2019-10-11 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92070

Bug ID: 92070
   Summary: [10 regression] -fchecking=2 error: taking address of
rvalue
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r276763 PASS
r276764 FAIL

clang-8 PASS

$ cat x.ii
struct a;
struct b {
  static a c();
};
struct a : b {};
template  struct d {
  void e() { 0 ? b() : b::c(); }
};

$ g++ -fpreprocessed -fchecking=2 -Wall -Wextra -c x.ii
x.ii: In member function ‘void d<  >::e()’:
x.ii:7:28: error: taking address of rvalue [-fpermissive]
7 |   void e() { 0 ? b() : b::c(); }
  |^~
x.ii:7:28: error: taking address of rvalue [-fpermissive]

$ clang++ -Wall -c x.ii

[Bug c++/92068] New: [8 regression] ICE on invalid in process_partial_specialization

2019-10-11 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92068

Bug ID: 92068
   Summary: [8 regression] ICE on invalid in
process_partial_specialization
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r258989 PASS
r259099 FAIL
r276845 FAIL

$ cat x.ii
template  struct a;
template  struct a:

$ g++ -fpreprocessed -c x.ii
x.ii:2:57: error: partial specialization 'struct a' is not more
specialized than [-fpermissive]
2 | template  struct a:
  | ^
x.ii:1:38: note: primary template 'template struct a'
1 | template  struct a;
  |  ^
x.ii:2:57: internal compiler error: in process_partial_specialization, at
cp/pt.c:5072
2 | template  struct a:
  | ^
0x67c6f4 process_partial_specialization
/home/dimhen/src/gcc_current/gcc/cp/pt.c:5072
0xb7c5fd push_template_decl_real(tree_node*, bool)
/home/dimhen/src/gcc_current/gcc/cp/pt.c:5616
0xb7c5fd push_template_decl(tree_node*)
/home/dimhen/src/gcc_current/gcc/cp/pt.c:6021
0xb7c5fd maybe_process_partial_specialization(tree_node*)
/home/dimhen/src/gcc_current/gcc/cp/pt.c:1006
0xb0952c cp_parser_class_head
/home/dimhen/src/gcc_current/gcc/cp/parser.c:24249
0xb0952c cp_parser_class_specifier_1
/home/dimhen/src/gcc_current/gcc/cp/parser.c:23536
0xb0a0ce cp_parser_class_specifier
/home/dimhen/src/gcc_current/gcc/cp/parser.c:23914
0xb0a0ce cp_parser_type_specifier
/home/dimhen/src/gcc_current/gcc/cp/parser.c:17512
0xb0b159 cp_parser_decl_specifier_seq
/home/dimhen/src/gcc_current/gcc/cp/parser.c:14204
0xb2ee55 cp_parser_single_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:28910
0xb2f1db cp_parser_template_declaration_after_parameters
/home/dimhen/src/gcc_current/gcc/cp/parser.c:28573
0xb2f93e cp_parser_explicit_template_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:28839
0xb32ef9 cp_parser_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13242
0xb3349e cp_parser_translation_unit
/home/dimhen/src/gcc_current/gcc/cp/parser.c:4732
0xb3349e c_parse_file()
/home/dimhen/src/gcc_current/gcc/cp/parser.c:42778
0xc356eb c_common_parse_file()
/home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1179
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug rtl-optimization/91976] [10 regression] RTL check: expected code 'const_int', have 'reg' in emit_block_move_hints, at expr.c:1627

2019-10-03 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91976

--- Comment #5 from Dmitry G. Dyachenko  ---
r276503 PASS for me

Thank you, Jakub

[Bug rtl-optimization/91976] [10 regression] RTL check: expected code 'const_int', have 'reg' in emit_block_move_hints, at expr.c:1627

2019-10-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91976

--- Comment #1 from Dmitry G. Dyachenko  ---
FAIL: configure --enable-checking=yes,rtl --enable-languages=c,c++,lto
--disable-multilib

PASS: configure --enable-checking=yes --enable-languages=c,c++,lto
--disable-multilib

[Bug rtl-optimization/91976] New: [10 regression] RTL check: expected code 'const_int', have 'reg' in emit_block_move_hints, at expr.c:1627

2019-10-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91976

Bug ID: 91976
   Summary: [10 regression] RTL check: expected code 'const_int',
have 'reg' in emit_block_move_hints, at expr.c:1627
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

gcc bootstrap
r276439 PASS
r276476 FAIL

Fedora 30 x86_64

/home/dimhen/src/gcc_current/configure --prefix=/usr/local/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native

make
...
/home/dimhen/build/gcc_current/./gcc/xgcc
-B/home/dimhen/build/gcc_current/./gcc/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/bin/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/gcc_current/x86_64-pc-linux-gnu/include -isystem
/usr/local/gcc_current/x86_64-pc-linux-gnu/sys-include   -fno-checking -g -O2
-O2  -g -O2 -DIN_GCC-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include   -fpic -mlong-double-80 -DUSE_ELF_SYMVER -fcf-protection
-mshstk -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic
-mlong-double-80 -DUSE_ELF_SYMVER -fcf-protection -mshstk -I. -I. -I../.././gcc
-I/home/dimhen/src/gcc_current/libgcc -I/home/dimhen/src/gcc_current/libgcc/.
-I/home/dimhen/src/gcc_current/libgcc/../gcc
-I/home/dimhen/src/gcc_current/libgcc/../include
-I/home/dimhen/src/gcc_current/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
-DHAVE_CC_TLS  -DUSE_TLS -o _gcov.o -MT _gcov.o -MD -MP -MF _gcov.dep -DL_gcov
-c /home/dimhen/src/gcc_current/libgcc/libgcov-driver.c
during RTL pass: expand
In file included from /home/dimhen/src/gcc_current/libgcc/libgcov-driver.c:214:
/home/dimhen/src/gcc_current/libgcc/libgcov-driver-system.c: In function
'gcov_do_dump':
/home/dimhen/src/gcc_current/libgcc/libgcov-driver-system.c:252:26: internal
compiler error: RTL check: expected code 'const_int', have 'reg' in
emit_block_move_hints, at expr.c:1627
  252 |   char *p = (char *) memcpy (gf->prefix, gcov_prefix,
prefix_length);
  | 
^~~
0x1218bf6 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/home/dimhen/src/gcc_current/gcc/rtl.c:879
0xc8346e emit_block_move_hints(rtx_def*, rtx_def*, rtx_def*, block_op_methods,
unsigned int, long, unsigned long, unsigned long, unsigned long, bool, bool*,
bool)
/home/dimhen/src/gcc_current/gcc/expr.c:1627
0xa441ae expand_builtin_memory_copy_args
/home/dimhen/src/gcc_current/gcc/builtins.c:3936
0xa439da expand_builtin_memcpy
/home/dimhen/src/gcc_current/gcc/builtins.c:3793
0xa50c08 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
/home/dimhen/src/gcc_current/gcc/builtins.c:7644
0xcb582d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/dimhen/src/gcc_current/gcc/expr.c:11108
0xca7170 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/dimhen/src/gcc_current/gcc/expr.c:8327
0xc9ab8d store_expr(tree_node*, rtx_def*, int, bool, bool)
/home/dimhen/src/gcc_current/gcc/expr.c:5723
0xc98ed0 expand_assignment(tree_node*, tree_node*, bool)
/home/dimhen/src/gcc_current/gcc/expr.c:5485
0xa9ecd9 expand_call_stmt
/home/dimhen/src/gcc_current/gcc/cfgexpand.c:2729
0xaa2d2d expand_gimple_stmt_1
/home/dimhen/src/gcc_current/gcc/cfgexpand.c:3710
0xaa3471 expand_gimple_stmt
/home/dimhen/src/gcc_current/gcc/cfgexpand.c:3875
0xaace9b expand_gimple_basic_block
/home/dimhen/src/gcc_current/gcc/cfgexpand.c:5914
0xaae9eb execute
/home/dimhen/src/gcc_current/gcc/cfgexpand.c:6554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug target/91498] [10 Regression] STV change in r274481 causes 300.twolf regression on Haswell

2019-08-21 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91498

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #12 from Dmitry G. Dyachenko  ---
(In reply to Arseny Solokha from comment #9)
> (In reply to H.J. Lu from comment #7)
> > Our SPEC CPU 2017 failed with
> > 
> >  39 util.c:205:1: error: invalid rtl sharing found in the insn
> >  40   205 | }
> >  41   | ^
> >  42 (insn 29 28 3 2 (set (subreg:V2DI (reg:DI 91) 0)
> >  43 (vec_concat:V2DI (mem/c:DI (plus:DI (reg/f:DI 19 frame)
> >  44 (const_int -8 [0xfff8])) [0  S8 A64])
> >  45 (const_int 0 [0]))) "util.c":134:1 -1
> >  46  (nil))
> >  47 util.c:205:1: error: shared rtx
> >  48 (mem/c:DI (plus:DI (reg/f:DI 19 frame)
> >  49 (const_int -8 [0xfff8])) [0  S8 A64])
> >  50 during RTL pass: stv
> > 
> > We have an invalid shared rtx.
> 
> And the testcase is as simple as:
> 
> int
> ff (int jn)
> {
>   return jn > 0 ? jn : 0;
> }
> 
> % x86_64-unknown-linux-gnu-gcc-10.0.0-alpha20190818 -march=nano-3000 -Os -c
> f9272pqv.c
> f9272pqv.c: In function 'ff':
> f9272pqv.c:5:1: error: invalid rtl sharing found in the insn
> 5 | }
>   | ^
> (insn 18 17 3 2 (set (subreg:V4SI (reg:SI 87) 0)
> (vec_merge:V4SI (vec_duplicate:V4SI (mem/c:SI (plus:DI (reg/f:DI 19
> frame)
> (const_int -4 [0xfffc])) [0  S4 A32]))
> (const_vector:V4SI [
> (const_int 0 [0]) repeated x4
> ])
> (const_int 1 [0x1]))) "f9272pqv.c":3:1 -1
>  (nil))
> f9272pqv.c:5:1: error: shared rtx
> (mem/c:SI (plus:DI (reg/f:DI 19 frame)
> (const_int -4 [0xfffc])) [0  S4 A32])
> during RTL pass: stv
> f9272pqv.c:5:1: internal compiler error: internal consistency failure
> 0x9f3eca verify_rtx_sharing
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/emit-rtl.c:2927
> 0x9f3dba verify_rtx_sharing
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/emit-rtl.c:2942
> 0x9f3dba verify_rtx_sharing
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/emit-rtl.c:2942
> 0x9f3dba verify_rtx_sharing
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/emit-rtl.c:2942
> 0x9f4178 verify_insn_sharing
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/emit-rtl.c:3013
> 0x9f79ed verify_rtl_sharing()
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/emit-rtl.c:3036
> 0xc7a8f3 execute_function_todo
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/passes.c:2004
> 0xc7b536 execute_todo
>   
> /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20190818/work/gcc-10-20190818/
> gcc/passes.c:2037

sounds like PR91503

[Bug tree-optimization/37242] missed FRE opportunity because of signedness of addition

2019-08-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37242

--- Comment #24 from Dmitry G. Dyachenko  ---
r257061 optimize too

gcc version 8.0.1 20180125 (experimental) [trunk revision 257061] (GCC)

[Bug tree-optimization/37242] missed FRE opportunity because of signedness of addition

2019-08-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37242

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #23 from Dmitry G. Dyachenko  ---
sounds like gcc10 r274581 optimize c#3 and c#4

c#3 gcc -O -S x.c
f:
.LFB0:
.cfi_startproc
leal2(%rdi,%rdi), %eax
ret
.cfi_endproc

c#4 gcc -O -S y.c
m:
.LFB0:
.cfi_startproc
movl$0, %eax
ret
.cfi_endproc

$ /usr/local/gcc_current/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20190816 (experimental) [trunk revision 274581] (GCC)

[Bug c/90872] [8/9/10 regression] ICE on invalid in contains_struct_check()

2019-07-23 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90872

--- Comment #1 from Dmitry G. Dyachenko  ---
probably start at r267665

[Bug rtl-optimization/91223] [10 regression] ICE: in curr_insn_transform, at lra-constraints.c:4459

2019-07-22 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91223

--- Comment #1 from Dmitry G. Dyachenko  ---
slightly reduced

$ cat y.i
int a, g;
int *b, *f, *h;
void *memcpy(void *, const void *, unsigned long);
typedef struct {
  int b;
} * c;
int d(void);
c e;
int d() {
  char c[16];
bd:
  for (a = 0; a <= 1; a++) {
*c = *f;
*(c + 8 + 5) = *(c + 8 + 6) = g + 1;
unsigned long d[2];
*d = c[0] + c[1];
*(d + 1) = *(b + c[0]) * *b;
*d = *d ^ c[1];
*(d + 1) =
*(d + 1) ^ (long)b ^ c[5] << 1 ^ *(unsigned long *)b ^ *c ^ *(b +
c[1]);
*d = *d ^ *(b + c[13]);
*(d + 1) = *(d + 1) ^ *(b + c[13] + 1);
*d = *d ^ *(b + 1) ^ c[14] * c[15];
*(d + 1) = *(d + 1) ^ *b;
memcpy(c, d, 16);
  }
  *(c + 8) = *(c + 8) ^ *f ^ e->b;
  memcpy(h, c, 16);
  if (0)
goto bd;
  return 0;
}

[Bug rtl-optimization/91223] New: [10 regression] ICE: in curr_insn_transform, at lra-constraints.c:4459

2019-07-22 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91223

Bug ID: 91223
   Summary: [10 regression] ICE: in curr_insn_transform, at
lra-constraints.c:4459
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r273563 PASS
r273642 FAIL

$ /usr/local/gcc_current/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20190721 (experimental) [trunk revision 273642] (GCC) 

$ /usr/local/gcc_current/bin/gcc -fpreprocessed -O -c x.i
during RTL pass: reload
x.i: In function ‘d’:
x.i:35:1: internal compiler error: in curr_insn_transform, at
lra-constraints.c:4459
   35 | }
  | ^
0x6c44d9 curr_insn_transform
/home/dimhen/src/gcc_current/gcc/lra-constraints.c:4459
0xe5c58e lra_constraints(bool)
/home/dimhen/src/gcc_current/gcc/lra-constraints.c:4987
0xe47a24 lra(_IO_FILE*)
/home/dimhen/src/gcc_current/gcc/lra.c:2468
0xdf89a9 do_reload
/home/dimhen/src/gcc_current/gcc/ira.c:5522
0xdf89a9 execute
/home/dimhen/src/gcc_current/gcc/ira.c:5706
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat x.i
int a;
int *aw;
void *memcpy(void *, const void *, unsigned long);
typedef struct {
  int b;
} * c;
int d(void);
c e;
int *f;
int g;
int *h;
int d() {
  char bc[16];
bd:
  for (a = 0; a <= 1; a++) {
*bc = *f;
*(bc + 8 + 5) = *(bc + 8 + 6) = g + 1;
unsigned long be[2];
*be = bc[0] + bc[1];
*(be + 1) = *(aw + bc[0]) * *aw;
*be = *be ^ bc[1];
*(be + 1) = *(be + 1) ^ (long)aw ^ bc[5] << 1 ^ *(unsigned long *)aw ^ *bc
^
*(aw + bc[1]);
*be = *be ^ *(aw + bc[13]);
*(be + 1) = *(be + 1) ^ *(aw + bc[13] + 1);
*be = *be ^ *(aw + 1) ^ bc[14] * bc[15];
*(be + 1) = *(be + 1) ^ *aw;
memcpy(bc, be, 16);
  }
  *(bc + 8) = *(bc + 8) ^ *f ^ e->b;
  memcpy(h, bc, 16);
  if (0)
goto bd;
  return 0;
}

$ /usr/local/gcc_current/bin/gcc -fpreprocessed -O -c small_bad.i 
small_bad.i:1:9: warning: type defaults to ‘int’ in declaration of ‘a’
[-Wimplicit-int]
1 | typedef a;
  | ^
small_bad.i:2:1: warning: data definition has no type or storage class
2 | d, e;
  | ^
small_bad.i:2:1: warning: type defaults to ‘int’ in declaration of ‘d’
[-Wimplicit-int]
small_bad.i:2:4: warning: type defaults to ‘int’ in declaration of ‘e’
[-Wimplicit-int]
2 | d, e;
  |^
small_bad.i:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
3 | f() {
  | ^
small_bad.i: In function ‘f’:
small_bad.i:11:40: warning: implicit declaration of function ‘j’
[-Wimplicit-function-declaration]
   11 | *(g + (1 << h[1])) = *g << h[11] + j(0, 0, 0);
  |^
small_bad.i:14:3: warning: implicit declaration of function ‘memcpy’
[-Wimplicit-function-declaration]
   14 |   memcpy(0, h, 16);
  |   ^~
small_bad.i:14:3: warning: incompatible implicit declaration of built-in
function ‘memcpy’
small_bad.i:1:1: note: include ‘’ or provide a declaration of
‘memcpy’
  +++ |+#include 
1 | typedef a;
during RTL pass: reload
small_bad.i:15:1: internal compiler error: in curr_insn_transform, at
lra-constraints.c:4459
   15 | }
  | ^
0x6c44d9 curr_insn_transform
/home/dimhen/src/gcc_current/gcc/lra-constraints.c:4459
0xe5c58e lra_constraints(bool)
/home/dimhen/src/gcc_current/gcc/lra-constraints.c:4987
0xe47a24 lra(_IO_FILE*)
/home/dimhen/src/gcc_current/gcc/lra.c:2468
0xdf89a9 do_reload
/home/dimhen/src/gcc_current/gcc/ira.c:5522
0xdf89a9 execute
/home/dimhen/src/gcc_current/gcc/ira.c:5706
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat small_bad.i 
typedef a;
d, e;
f() {
  a b, c, *g, i;
  char h[16];
  b = e;
  c = d;
  for (; i <= 0; i++) {

[Bug middle-end/91195] New: [10 regression] incorrect may be used uninitialized smw (272711, 273474]

2019-07-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91195

Bug ID: 91195
   Summary: [10 regression] incorrect may be used uninitialized
smw (272711, 273474]
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r272711 PASS
r273474 FAIL
r273563 FAIL

$ ~/arch-gcc/gcc_272711/bin/gcc -Werror=maybe-uninitialized -O2 -c x.c -DFOUR
$ ~/arch-gcc/gcc_273474/bin/gcc -Werror=maybe-uninitialized -O2 -c x.c
$ ~/arch-gcc/gcc_273474/bin/gcc -Werror=maybe-uninitialized -O2 -c x.c -DFOUR
x.c: In function ‘foo’:
x.c:15:13: error: ‘Msg[0]’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
   15 |  Msg[num++] = m1;
  |  ~~~^~~~
cc1: some warnings being treated as errors

$ cat x.c
int f(char*);

#if defined FOUR
#define FOR_UP_LIMIT 4 // FAIL
#else
#define FOR_UP_LIMIT 3 // PASS
#endif

void foo(char *m1, char* m2)
{
char* Msg[2];
int num = 0;

if(m1)
Msg[num++] = m1;
if(m2)
Msg[num++] = m2;

for (int j = 0; j < FOR_UP_LIMIT; j++) 
switch (j) {
case 0:
if(num == 0 || f(Msg[0]) )
break;
}
}

[Bug c/91193] [8/9/10 regression] ICE on invalid: tree check: expected class ‘type’, have ‘declaration’ (function_decl) in grokdeclarator, at c/c-decl.c:5956

2019-07-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91193

--- Comment #3 from Dmitry G. Dyachenko  ---
(In reply to Jakub Jelinek from comment #1)
> Why do you think this is a regression?
> /usr/src/gcc-test/obj/gcc/cc1.9 pr91193.c
>  a
> 
> pr91193.c:2: error: ‘a’ redeclared as different kind of symbol
> pr91193.c:1: error: previous declaration of ‘a’ was here
> pr91193.c: In function ‘a’:
> pr91193.c:2: internal compiler error: tree check: expected class ‘type’,
> have ‘declaration’ (function_decl) in grokdeclarator, at c-decl.c:3788
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See http://gcc.gnu.org/bugs.html> for instructions.
> 
> I don't have anything older than r9.
> 
> And slightly cleaner
> typedef int a;
> void a() a b;
> also ICEs.

You are right. Sounds like not a regression.
Sorry

[Bug c/91193] New: [8 regression] ICE on invalid: tree check: expected class ‘type’, have ‘declaration’ (function_decl) in grokdeclarator, at c/c-decl.c:5956

2019-07-17 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91193

Bug ID: 91193
   Summary: [8 regression] ICE on invalid: tree check: expected
class ‘type’, have ‘declaration’ (function_decl) in
grokdeclarator, at c/c-decl.c:5956
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r257061 FAIL
r273505 FAIL

$ cat x.i
typedef a;
void a() a b;

$ /usr/local/gcc_current/bin/gcc -fpreprocessed x.i
x.i:1:9: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
1 | typedef a;
  | ^
x.i:2:6: error: ‘a’ redeclared as different kind of symbol
2 | void a() a b;
  |  ^
x.i:1:9: note: previous declaration of ‘a’ was here
1 | typedef a;
  | ^
x.i: In function ‘a’:
x.i:2:1: internal compiler error: tree check: expected class ‘type’, have
‘declaration’ (function_decl) in grokdeclarator, at c/c-decl.c:5956
2 | void a() a b;
  | ^~~~
0x7a948e tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/dimhen/src/gcc_current/gcc/tree.c:9953
0x5db72d tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/dimhen/src/gcc_current/gcc/tree.h:3340
0x5db72d grokdeclarator
/home/dimhen/src/gcc_current/gcc/c/c-decl.c:5956
0xa39e3b start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
/home/dimhen/src/gcc_current/gcc/c/c-decl.c:4872
0xa8e114 c_parser_declaration_or_fndef
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:2159
0xa8f16a c_parser_declaration_or_fndef
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:2321
0xa963cf c_parser_external_declaration
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:1658
0xa96e19 c_parser_translation_unit
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:1539
0xa96e19 c_parse_file()
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:20010
0xaecfcb c_common_parse_file()
/home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1160
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ /usr/local/gcc_current/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20190716 (experimental) [trunk revision 273505] (GCC)

[Bug preprocessor/91192] New: [9 regression] non-deterministic ICE on invalid

2019-07-17 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91192

Bug ID: 91192
   Summary: [9 regression] non-deterministic ICE on invalid
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

gcc -fpreprocessed -c x.i can
-- report error
-- ICE in linemap_macro_map_lookup, at libcpp/line-map.c:1003
-- crash_signal in get_location_from_adhoc_loc libcpp/line-map.c:257

r266365 PASS (?)
r266815 FAIL
r273505 FAIL

$ cat x.i
a() {
   b; 0( sizeof

$ /usr/local/gcc_current/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20190716 (experimental) [trunk revision 273505] (GCC) 


$ /usr/local/gcc_current/bin/gcc -fpreprocessed -c x.i
x.i:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | a() {
  | ^
x.i: In function ‘a’:
x.i:2:4: error: ‘b’ undeclared (first use in this function)
2 |b; 0( sizeof
  |^
x.i:2:4: note: each undeclared identifier is reported only once for each
function it appears in
x.i:2:4: error: expected expression at end of input
x.i:2:7: error: called object is not a function or function pointer
2 |b; 0( sizeof
  |   ^
x.i:2:4: error: expected declaration or statement at end of input
2 |b; 0( sizeof
  |^


$ /usr/local/gcc_current/bin/gcc -fpreprocessed -c x.i
x.i:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | a() {
  | ^
x.i: In function ‘a’:
x.i:2:4: error: ‘b’ undeclared (first use in this function)
2 |b; 0( sizeof
  |^
x.i:2:4: note: each undeclared identifier is reported only once for each
function it appears in
x.i:2:4: error: expected expression at end of input
x.i:2:4: internal compiler error: in linemap_macro_map_lookup, at
libcpp/line-map.c:1003
0x1a996ac linemap_macro_map_lookup
/home/dimhen/src/gcc_current/libcpp/line-map.c:1003
0x1a996ac linemap_lookup(line_maps*, unsigned int)
/home/dimhen/src/gcc_current/libcpp/line-map.c:937
0x1a9a29b get_pure_location(line_maps*, unsigned int)
/home/dimhen/src/gcc_current/libcpp/line-map.c:331
0x1a7b43d get_pure_location
/home/dimhen/src/gcc_current/gcc/input.h:147
0x1a7b43d make_location(unsigned int, unsigned int, unsigned int)
/home/dimhen/src/gcc_current/gcc/input.c:891
0xa7c5b1 c_expr::get_location() const
/home/dimhen/src/gcc_current/gcc/c/c-tree.h:159
0xa7c5b1 c_parser_expr_list
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:9854
0xa7d03c c_parser_postfix_expression_after_primary
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:9588
0xa6e5e1 c_parser_postfix_expression
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:9293
0xa782df c_parser_unary_expression
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:7403
0xa79a6f c_parser_cast_expression
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:7245
0xa79ce3 c_parser_binary_expression
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:7048
0xa7ac15 c_parser_conditional_expression
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:6782
0xa7b250 c_parser_expr_no_commas
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:6699
0xa7b4b1 c_parser_expression
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:9754
0xa7bbd7 c_parser_expression_conv
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:9787
0xa8b3c3 c_parser_statement_after_labels
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:5616
0xa8d481 c_parser_compound_statement_nostart
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:5154
0xa8da18 c_parser_compound_statement
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:4988
0xa8f33e c_parser_declaration_or_fndef
/home/dimhen/src/gcc_current/gcc/c/c-parser.c:2360
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


[dimhen:dim E1]$ /usr/local/gcc_current/bin/gcc -fpreprocessed -c x.i
x.i:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | a() {
  |

[Bug ipa/90891] lto-bootstrap with ada enabled broken on x86_64

2019-06-15 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90891

Dmitry G. Dyachenko  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #1 from Dmitry G. Dyachenko  ---
PR90889 dup?

[Bug tree-optimization/90872] New: [8 regression] ICE on invalid in contains_struct_check()

2019-06-13 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90872

Bug ID: 90872
   Summary: [8 regression] ICE on invalid in
contains_struct_check()
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r267346 PASS
r267961 FAIL
r272203 FAIL

$ cat x.i
a() {
  void b() = ;
  b == 0
$ /usr/local/gcc_current/bin/gcc -fpreprocessed -c x.i
x.i:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
1 | a() {
  | ^
x.i: In function 'a':
x.i:2:3: error: function 'b' is initialized like a variable
2 |   void b() = ;
  |   ^~~~
x.i:2:14: error: expected expression before ';' token
2 |   void b() = ;
  |  ^
x.i:3:9: error: expected ';' at end of input
3 |   b == 0
  | ^
  | ;
x.i:3:3: error: expected declaration or statement at end of input
3 |   b == 0
  |   ^
x.i:1:1: internal compiler error: Segmentation fault
1 | a() {
  | ^
0xfeddbf crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0xd3aee7 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
/home/dimhen/src/gcc_current/gcc/tree.h:3310
0xd3aee7 unshare_body
/home/dimhen/src/gcc_current/gcc/gimplify.c:933
0xd3af82 unshare_body
/home/dimhen/src/gcc_current/gcc/gimplify.c:940
0xd47262 gimplify_body(tree_node*, bool)
/home/dimhen/src/gcc_current/gcc/gimplify.c:13902
0xd47697 gimplify_function_tree(tree_node*)
/home/dimhen/src/gcc_current/gcc/gimplify.c:14058
0xb9ea77 cgraph_node::analyze()
/home/dimhen/src/gcc_current/gcc/cgraphunit.c:667
0xba180d analyze_functions
/home/dimhen/src/gcc_current/gcc/cgraphunit.c:1126
0xba2462 symbol_table::finalize_compilation_unit()
/home/dimhen/src/gcc_current/gcc/cgraphunit.c:2833
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ /usr/local/gcc_current/bin/gcc -v   
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 10.0.0 20190612 (experimental) [trunk revision 272203] (GCC)

[Bug tree-optimization/90866] [10 Regression] ICE in fold_binary_loc, at fold-const.c:9827 since r272197

2019-06-13 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90866

--- Comment #6 from Dmitry G. Dyachenko  ---
(In reply to Dmitry G. Dyachenko from comment #5)
> $ cat x.i
> typedef enum { a } b;
> typedef struct {
>   int c[0];
> } d;
> typedef struct {
>   int *data;
> } e;
> typedef struct {
>   e buffer;
> } f;
> int g, h;
> int i();
> int i(f *j, d *k, b l, int m) {
>   if (l)
> if (m) {
>   h = j->buffer.data[0];
>   k->c[g] = k->c[g] * 8;
> }
>   return 0;
> 

add missed }

$ cat x.i
$ cat x.i
typedef enum { a } b;
typedef struct {
  int c[0];
} d;
typedef struct {
  int *data;
} e;
typedef struct {
  e buffer;
} f;
int g, h;
int i();
int i(f *j, d *k, b l, int m) {
  if (l)
if (m) {
  h = j->buffer.data[0];
  k->c[g] = k->c[g] * 8;
}
  return 0;
}

[Bug tree-optimization/90866] [10 Regression] ICE in fold_binary_loc, at fold-const.c:9827 since r272197

2019-06-13 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90866

--- Comment #5 from Dmitry G. Dyachenko  ---
$ cat x.i
typedef enum { a } b;
typedef struct {
  int c[0];
} d;
typedef struct {
  int *data;
} e;
typedef struct {
  e buffer;
} f;
int g, h;
int i();
int i(f *j, d *k, b l, int m) {
  if (l)
if (m) {
  h = j->buffer.data[0];
  k->c[g] = k->c[g] * 8;
}
  return 0;


$ gcc -fpreprocessed -O2 -fsanitize=thread -c x.i
during GIMPLE pass: strlen
x.i: In function ‘i’:
x.i:13:5: internal compiler error: in fold_binary_loc, at fold-const.c:9827
   13 | int i(f *j, d *k, b l, int m) {
  | ^
0x667691 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/home/dimhen/src/gcc_current/gcc/fold-const.c:9827
0xcc9bed fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/home/dimhen/src/gcc_current/gcc/fold-const.c:12338
0x11b4a62 get_stridx
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:327
0x11b4a62 get_stridx
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:293
0x11bb65c strlen_check_and_optimize_stmt
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:3721
0x11bb65c strlen_dom_walker::before_dom_children(basic_block_def*)
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:4009
0x18dfca2 dom_walker::walk(basic_block_def*)
/home/dimhen/src/gcc_current/gcc/domwalk.c:312
0x11b0ea0 execute
/home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:4089
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug sanitizer/90347] New: [UBSAN] __attribute__((weak))__ results in "declared weak after being used" error

2019-05-04 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90347

Bug ID: 90347
   Summary: [UBSAN] __attribute__((weak))__ results in "declared
weak after being used" error
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

$ cat x.cpp
struct s { };
extern s var;
// __attribute__ ((weak)) s var; // no error

extern void foo(s&);
void bar()
{
foo(var);
}

__attribute__ ((weak)) s var; // error


$ /usr/local/gcc_current/bin/g++ -fsanitize=undefined -Wall -c x.cpp
x.cpp:2:10: error: 'var' declared weak after being used
2 | extern s var;
  |  ^~~


$ /usr/local/gcc_current/bin/g++ -Wall -c x.cpp


$ $ /usr/local/gcc_current/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 10.0.0 20190503 (experimental) [trunk revision 270859] (GCC)

[Bug c/90036] [8/9/10 Regression] false positive: directive argument is null [-Werror=format-overflow=]

2019-04-27 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036

--- Comment #3 from Dmitry G. Dyachenko  ---
I see smth may be similar starts at r265648 / PR87041

265647 NO warnings
265648 warnings
270581 warnings

$ cat x.cpp
#include 
#include 

extern void extf(char*);

extern unsigned U1;
extern unsigned U2;

void foo()
{
if(U1 == 0)
return;
if(U2 == 0)
return;

std::vector N1(U1);
extf([0]);

std::vector N2(U2);
extf([0]);

printf("%s = %s\n", [0], [0]); // warning
}

void foo_i(unsigned i)
{
if(i == 0)
return;
if(U2 == 0)
return;

std::vector N1(i);
extf([0]);

std::vector N2(U2);
extf([0]);

printf("%s = %s\n", [0], [0]); // warning
}

void foo_j(unsigned j)
{
if(U1 == 0)
return;
if(j == 0)
return;

std::vector N1(U1);
extf([0]);

std::vector N2(j);
extf([0]);

printf("%s = %s\n", [0], [0]); // NO warning
}

void foo_2(unsigned i, unsigned j)
{
if(i == 0)
return;
if(j == 0)
return;

std::vector N1(i);
extf([0]);

std::vector N2(j);
extf([0]);

printf("%s = %s\n", [0], [0]);  // NO warning
}

$ g++ -O2 -Wall -Werror -c x.cpp
x.cpp: In function ‘void foo()’:
x.cpp:22:11: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   22 | printf("%s = %s\n", [0], [0]); // warning
  | ~~^
x.cpp: In function ‘void foo_i(unsigned int)’:
x.cpp:38:11: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   38 | printf("%s = %s\n", [0], [0]); // warning
  | ~~^

[Bug middle-end/90191] [9/10 regression] incorrect -Wformat-overflow with --param max-jump-thread-duplication-stmts=17

2019-04-26 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90191

--- Comment #5 from Dmitry G. Dyachenko  ---
(In reply to Jeffrey A. Law from comment #4)
> Actually I think the warning is valid.  Ramping up the aggressiveness of the
> threader is what ultimately exposes it.
[...]
> 
> But AFAICT the warning is 100% totally valid.  You just have to turn up the
> optimizer thresholds to expose it.

Jeff, thank you for clarification.
You are absolutely right -- my test is invalid.

Sorry for over-reducing

[Bug middle-end/90191] [9 regression] -Wformat-overflow depends on --param max-jump-thread-duplication-stmts=17

2019-04-23 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90191

--- Comment #2 from Dmitry G. Dyachenko  ---
(In reply to Richard Biener from comment #1)
> So is the warning good or bad?  That it now depends on the param suggests a
> change in default optimization behavior.

Sorry not to be clear

Warning with --param ... is incorrect.

And creduced testcase has "dead" code: "if(0) goto ...;"
May be some pass (jump-threading?) cant simplify it?

If so then smth like 90037 probably will be the root PR

[Bug middle-end/90191] New: [9 regression] -Wformat-overflow depends on --param max-jump-thread-duplication-stmts=17

2019-04-19 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90191

Bug ID: 90191
   Summary: [9 regression] -Wformat-overflow depends on --param
max-jump-thread-duplication-stmts=17
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r265568 PASS
r265754 FAIL
r270458 FAIL

Warn if compiled with "-O2 --param max-jump-thread-duplication-stmts=17"
And not warn if compiled with -O2

Original code fill & printf() 2 vectors of chars (pseudo-code see below)
-- If second vector is in "if() {}" then warning emitted.
-- If second vector is out of "if() {}" then no warning produced.
-- if printf() divided into 2 printf there are no warning.

$ cat a.ii
extern "C" int printf(const char *...);
struct i {
  void j(char *p1, int) { delete p1; }
};
struct q {
  typedef char 
};
struct t {
  static char *u();
};
template  void ad(e, ab, g,
h);
char *m;
struct v {
  struct w {
char *l;
  };
  v(int p1) {
int o = p1, a = o;
m = a ? t::u() : 0;
n.l = m;
  }
  ~v() {
char *c = n.l, *p = c;
int f = 0;
i k;
k.j(p, f);
  }
  w n;
};
int s;
struct x : v {
  x() : v(y()) {
i b;
ad(0, 0, s, b);
  }
  q::d operator[](int p1) { return *(n.l + p1); }
  static int y();
};
unsigned ap();
char r;
static int av() {
  {
x d;
if (0)
  goto ay;
char  = d[0];
printf("%s = %s\n", , );
  }
ay:
  return 0;
}
unsigned ap() {
  av();
  return 0;
}

$ /usr/local/gcc_current/bin/g++ -O2 -fpreprocessed -Wall -Wextra -c a.ii
$ /usr/local/gcc_current/bin/g++ -O2 --param
max-jump-thread-duplication-stmts=17 -fpreprocessed -Wall -Wextra -c a.ii
In function 'int av()',
inlined from 'unsigned int ap()' at a.ii:53:5:
a.ii:47:11: warning: '%s' directive argument is null [-Wformat-overflow=]
   47 | printf("%s = %s\n", , );
  | ~~^


Original code looks as

size_t l1, l2, sel;
if(foo_1())
  goto err;
if(foo_2(, ))
  goto err;

std::vector v(l1);
if(bar_1([0])
  goto err;

if(sel) {
  std::vector w(l2); // <--- if move out of block then warning disappears
  if(bar_2([0]))
 goto err;
  printf("%s = %s\n", [0], [0]); // <-- if divided to 2 calls then warning
disappears
  return;
}

err:
  return;


$ /usr/local/gcc_current/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/9.0.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 9.0.1 20190419 (experimental) [trunk revision 270458] (GCC)

[Bug c++/90138] New: ICE on invalid in contains_struct_check()

2019-04-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90138

Bug ID: 90138
   Summary: ICE on invalid in contains_struct_check()
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r270434 --enable-checking=release not ICE
r270435 --enable-checking=yes,df,fold,rtl,extra ICE

$ cat x_2.ii
template <, typename a, typename typename, typename a,

$ g++ -fpreprocessed -fsyntax-only -c a.ii^C
[dimhen:dim ice]$ cat x_2.ii
template <, typename a, typename typename, typename a,[dimhen:dim ice]$ cat
x_2.ii
[dimhen:dim ice]$ /usr/local/gcc_current/bin/g++ -fpreprocessed -fsyntax-only
-c x_2.ii
x_2.ii:1:11: error: expected identifier before ‘,’ token
1 | template <, typename a, typename typename, typename a,
  |   ^
x_2.ii:1:34: error: expected nested-name-specifier before ‘typename’
1 | template <, typename a, typename typename, typename a,
  |  ^~~~
x_2.ii:1:42: error: expected nested-name-specifier before ‘,’ token
1 | template <, typename a, typename typename, typename a,
  |  ^
x_2.ii:1:42: error: two or more data types in declaration of ‘parameter’
x_2.ii:1:54: error: expected identifier at end of input
1 | template <, typename a, typename typename, typename a,
  |  ^
x_2.ii:1:54: internal compiler error: Segmentation fault
0x11f6bdf crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0x7f69746b55ff ???
   
/usr/src/debug/glibc-2.28-95-g7423da211d/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xc1a517 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
/home/dimhen/src/gcc_current/gcc/tree.h:3289
0xc1a517 process_template_parm(tree_node*, unsigned int, tree_node*, bool,
bool)
/home/dimhen/src/gcc_current/gcc/cp/pt.c:4345
0xbfab99 cp_parser_template_parameter_list
/home/dimhen/src/gcc_current/gcc/cp/parser.c:15642
0xc01694 cp_parser_explicit_template_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:28091
0xc01694 cp_parser_template_declaration_after_export
/home/dimhen/src/gcc_current/gcc/cp/parser.c:28125
0xc041f9 cp_parser_declaration
/home/dimhen/src/gcc_current/gcc/cp/parser.c:13187
0xc0484f cp_parser_translation_unit
/home/dimhen/src/gcc_current/gcc/cp/parser.c:4701
0xc0484f c_parse_file()
/home/dimhen/src/gcc_current/gcc/cp/parser.c:41181
0xd0b1fb c_common_parse_file()
/home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1156
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ /usr/local/gcc_current/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/9.0.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 9.0.1 20190418 (experimental) [trunk revision 270435] (GCC)

[Bug bootstrap/89560] [9 regression] ICE In function 'rtx_def* gen_vec_extract_lo_v64qi(rtx, rtx)'

2019-03-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89560

--- Comment #6 from Dmitry G. Dyachenko  ---
PASS
/home/dimhen/src/gcc_current/configure --enable-checking=yes
--enable-languages=c,c++,lto --disable-multilib --with-tune=native

FAIL
/home/dimhen/src/gcc_current/configure --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --with-tune=native

[Bug bootstrap/89560] [9 regression] ICE In function 'rtx_def* gen_vec_extract_lo_v64qi(rtx, rtx)'

2019-03-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89560

--- Comment #5 from Dmitry G. Dyachenko  ---
(In reply to Jakub Jelinek from comment #4)
> E.g.
> gcc -v -mtune=native -xc /dev/null -S -o /dev/null 2>&1 | grep cc1

SkyLake

cc -v -mtune=native -xc /dev/null -S -o /dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/x86_64-redhat-linux/8/cc1 -quiet -v /dev/null --param
l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144
-mtune=skylake -quiet -dumpbase null -march=x86-64 -auxbase-strip /dev/null
-version -o /dev/null

[Bug bootstrap/89560] [9 regression] ICE In function 'rtx_def* gen_vec_extract_lo_v64qi(rtx, rtx)'

2019-03-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89560

--- Comment #3 from Dmitry G. Dyachenko  ---
(In reply to Jakub Jelinek from comment #2)
> What does your -mtune=native expand to?
How I can see it?

> Can you reproduce also without say --enable-offload-targets=nvptx-none?
Yes, I'll rebuild without extra options.

> Why are you using --enable-libmpx when MPX is gone?
I copy configure options from Fedora' gcc and miss MPX gone.

[Bug bootstrap/89560] [9 regression] ICE In function 'rtx_def* gen_vec_extract_lo_v64qi(rtx, rtx)'

2019-03-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89560

--- Comment #1 from Dmitry G. Dyachenko  ---
r269158 PASS

[Bug bootstrap/89560] New: [9 regression] ICE In function 'rtx_def* gen_vec_extract_lo_v64qi(rtx, rtx)'

2019-03-02 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89560

Bug ID: 89560
   Summary: [9 regression] ICE In function 'rtx_def*
gen_vec_extract_lo_v64qi(rtx, rtx)'
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r268977 bootstrap PASS
r269340 FAIL

Fedora 29 / x86_64

$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 158
model name  : Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz
stepping: 9
microcode   : 0x8e

configured as

$ /home/dimhen/src/gcc_current/configure --prefix=/usr/local/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-libmpx
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --with-tune=native

$ make
[...]

/home/dimhen/build/gcc_current/./prev-gcc/xg++
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/dimhen/src/gcc_current/libstdc++-v3/libsupc++
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-fno-PIE -c   -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common
 -DHAVE_CONFIG_H -I. -I. -I/home/dimhen/src/gcc_current/gcc
-I/home/dimhen/src/gcc_current/gcc/.
-I/home/dimhen/src/gcc_current/gcc/../include
-I/home/dimhen/src/gcc_current/gcc/../libcpp/include
-I/home/dimhen/build/gcc_current/./gmp -I/home/dimhen/src/gcc_current/gmp
-I/home/dimhen/build/gcc_current/./mpfr/src
-I/home/dimhen/src/gcc_current/mpfr/src -I/home/dimhen/src/gcc_current/mpc/src 
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber/bid -I../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libbacktrace
-I/home/dimhen/build/gcc_current/./isl/include
-I/home/dimhen/src/gcc_current/isl/include  -o insn-emit.o -MT insn-emit.o -MMD
-MP -MF ./.deps/insn-emit.TPo insn-emit.c
In file included from /home/dimhen/src/gcc_current/gcc/rtl.h:3771,
 from insn-emit.c:11:
insn-emit.c: In function 'rtx_def* gen_vec_extract_lo_v64qi(rtx, rtx)':
./genrtl.h:91:51: internal compiler error: Segmentation fault
   91 | gen_rtx_fmt_E_stat (c, m, p0 MEM_STAT_INFO)
  |   ^
./genrtl.h:39:40: note: in definition of macro 'gen_rtx_fmt_ee'
   39 | gen_rtx_fmt_ee_stat (c, m, p0, p1 MEM_STAT_INFO)
  |^~
insn-emit.c:22526:10: note: in expansion of macro 'gen_rtx_SET'
22526 |   return gen_rtx_SET (operand0,
  |  ^~~
./genrtl.h:1104:3: note: in expansion of macro 'gen_rtx_fmt_ee'
 1104 |   gen_rtx_fmt_ee (VEC_SELECT, (MODE), (ARG0), (ARG1))
  |   ^~
insn-emit.c:22527:2: note: in expansion of macro 'gen_rtx_VEC_SELECT'
22527 |  gen_rtx_VEC_SELECT (V32QImode,
  |  ^~
./genrtl.h:886:3: note: in expansion of macro 'gen_rtx_fmt_E'
  886 |   gen_rtx_fmt_E (PARALLEL, (MODE), (ARG0))
  |   ^
insn-emit.c:22529:2: note: in expansion of macro 'gen_rtx_PARALLEL'
22529 |  gen_rtx_PARALLEL (VOIDmode,
  |  ^~~~
0x157677c crash_signal
/home/dimhen/src/gcc_current/gcc/toplev.c:326
0x7f6b7db665bf ???
   
/usr/src/debug/glibc-2.28-60-g4d7af7815a/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xfbd3f7 fold_checksum_tree
/home/dimhen/src/gcc_current/gcc/fold-const.c:12168
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[3]: *** [Makefile:1116: insn-emit.o] Error 1
make[3]: Leaving directory '/home/dimhen/build/gcc_current/gcc'
make[2]: *** [Makefile:4707: all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/dimhen/build/gcc_current'

  1   2   3   4   >