[Bug c++/88122] New: g++ ICE: internal compiler error: Segmentation fault

2018-11-20 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88122

Bug ID: 88122
   Summary: g++ ICE: internal compiler error: Segmentation fault
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20181120 (experimental) [trunk revision 266315] (GCC)



$ g++-trunk abc.C
abc.C:7:6: error: use of deleted function ‘::(...)
[inherited from a]’
7 | } b{3};
  |  ^
abc.C:6:13: internal compiler error: Segmentation fault
6 |   using a ::a;
  | ^
0xf0a5cf crash_signal
../../gcc/gcc/toplev.c:326
0x92bc7b tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3153
0x92bc7b maybe_explain_implicit_delete(tree_node*)
../../gcc/gcc/cp/method.c:1824
0x8e9cdc mark_used(tree_node*, int)
../../gcc/gcc/cp/decl2.c:5353
0x852af1 build_over_call
../../gcc/gcc/cp/call.c:7917
0x856bda convert_like_real
../../gcc/gcc/cp/call.c:6939
0x856b0b convert_like_real
../../gcc/gcc/cp/call.c:7069
0x852979 build_over_call
../../gcc/gcc/cp/call.c:8181
0x85589f build_new_method_call_1
../../gcc/gcc/cp/call.c:9677
0x85589f build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
../../gcc/gcc/cp/call.c:9752
0x8564e9 build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int)
../../gcc/gcc/cp/call.c:9176
0x905312 expand_default_init
../../gcc/gcc/cp/init.c:1968
0x905312 expand_aggr_init_1
../../gcc/gcc/cp/init.c:2083
0x905bfa build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/init.c:1817
0x8ba84f build_aggr_init_full_exprs
../../gcc/gcc/cp/decl.c:6290
0x8ba84f check_initializer
../../gcc/gcc/cp/decl.c:6439
0x8d254c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7162
0x9757a6 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:20093
0x9599fa cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13269
0x97c3e9 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12966
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 abc.C
struct a {
  a(...);
  a();
};
struct : a {
  using a ::a;
} b{3};

[Bug tree-optimization/87546] New: Gcc miscompiles at -O3 on valid code

2018-10-07 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87546

Bug ID: 87546
   Summary: Gcc miscompiles at -O3 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It should be a very recent regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20181007 (experimental) [trunk revision 264906] (GCC)


$ gcc-trunk abc.c ; ./a.out
-37
$ gcc-trunk -O3 abc.c ; ./a.out
219


$ cat abc.c
int printf(const char *, ...);
int a;
long b, f;
char c, g;
short d = 219;
int e[7];
int main() {
  for (; c <= 6; c++) {
g = d < 0 ? d : d >> a;
f = g + b;
e[c] = f;
  }
  printf("%d\n", e[1]);
}

[Bug c++/87398] New: g++ ICE on valid code: tree check: expected record_type or union_type or qual_union_type, have array_type in cxx_eval_constant_expression, at cp/constexpr.c:4820

2018-09-23 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87398

Bug ID: 87398
   Summary: g++ ICE on valid code: tree check: expected
record_type or union_type or qual_union_type, have
array_type in cxx_eval_constant_expression, at
cp/constexpr.c:4820
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens with flag "-std=c++2a". It appears to start with r264408.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180923 (experimental) [trunk revision 264513] (GCC)


$ g++-trunk -std=c++2a abc.C
abc.C: In function ‘void c()’:
abc.C:7:20: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have array_type in cxx_eval_constant_expression,
at cp/constexpr.c:4820
7 |   int d(e[4][d].b());
  |^
0x79a6c4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9369
0x880c98 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
../../gcc/gcc/tree.h:3153
0x880c98 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4820
0x87bdd7 cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:1508
0x87df1d cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4284
0x8832fe cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:5018
0x886518 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:5245
0x8963d1 cp_fully_fold(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:2120
0x89e28f cp_convert_and_check(tree_node*, tree_node*, int)
../../gcc/gcc/cp/cvt.c:656
0x84c3b5 convert_like_real
../../gcc/gcc/cp/call.c:7219
0x84d508 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/call.c:10938
0xa15311 digest_init_r
../../gcc/gcc/cp/typeck2.c:1195
0xa17f02 digest_init_flags(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/typeck2.c:1211
0xa17f02 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:808
0x8ae4ed check_initializer
../../gcc/gcc/cp/decl.c:6481
0x8c657f cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7152
0x961466 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19893
0x968653 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13189
0x96a1b9 cp_parser_declaration_statement
../../gcc/gcc/cp/parser.c:12608
0x949023 cp_parser_statement
../../gcc/gcc/cp/parser.c:10953
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 abc.C
class a {
public:
  virtual long b();
};
void c() {
  a e[5][2];
  int d(e[4][d].b());
}

[Bug c++/87324] New: g++ ICE with overriding initializers: Segmentation fault

2018-09-15 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87324

Bug ID: 87324
   Summary: g++ ICE with overriding initializers: Segmentation
fault
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180915 (experimental) [trunk revision 264342] (GCC)


$ g++-trunk abc.C
abc.C:9:18: error: ‘.a’ designator used multiple times in the same initializer
list
9 | } d{.a = 7, .a = 8.09};
  |  ^~~~
abc.C:9:22: internal compiler error: Segmentation fault
9 | } d{.a = 7, .a = 8.09};
  |  ^
0xee340f crash_signal
../../gcc/gcc/toplev.c:325
0x923dc0 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3112
0x923dc0 get_class_binding_direct(tree_node*, tree_node*, int)
../../gcc/gcc/cp/name-lookup.c:1222
0xa176b8 process_init_constructor_record
../../gcc/gcc/cp/typeck2.c:1603
0xa176b8 process_init_constructor
../../gcc/gcc/cp/typeck2.c:1752
0xa176b8 digest_init_r
../../gcc/gcc/cp/typeck2.c:1166
0xa185e2 digest_init_flags(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/typeck2.c:1211
0xa185e2 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:808
0x8aee6d check_initializer
../../gcc/gcc/cp/decl.c:6479
0x8c6ebf cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7146
0x961bf6 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19893
0x968de3 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13189
0x96ddf2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12912
0x96e1ed cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12788
0x96e4e4 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4610
0x96e4e4 c_parse_file()
../../gcc/gcc/cp/parser.c:39122
0xa6cb3b c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1139
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 abc.C
struct {
  struct {
double a;
struct {
  short b;
};
  };
  int c;
} d{.a = 7, .a = 8.09};

[Bug tree-optimization/87211] New: gcc ICE at O2: in set_ssa_val_to, at tree-ssa-sccvn.c:3628

2018-09-04 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87211

Bug ID: 87211
   Summary: gcc ICE at O2: in set_ssa_val_to, at
tree-ssa-sccvn.c:3628
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens after the patch in r264069.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180903 (experimental) [trunk revision 264070] (GCC)


$ gcc-trunk -O2 abc.c -c
during GIMPLE pass: cunrolli
abc.c:7:6: internal compiler error: in set_ssa_val_to, at tree-ssa-sccvn.c:3628
7 | void f() {
  |  ^
0x6cb479 set_ssa_val_to
../../gcc/gcc/tree-ssa-sccvn.c:3628
0xe6c8da visit_phi
../../gcc/gcc/tree-ssa-sccvn.c:4229
0xe6ce8f visit_stmt
../../gcc/gcc/tree-ssa-sccvn.c:4272
0xe6e9e8 process_bb
../../gcc/gcc/tree-ssa-sccvn.c:5890
0xe6fca9 do_rpo_vn
../../gcc/gcc/tree-ssa-sccvn.c:6421
0xe70a37 do_rpo_vn(function*, edge_def*, bitmap_head*)
../../gcc/gcc/tree-ssa-sccvn.c:6567
0xdf7de8 tree_unroll_loops_completely
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1479
0xdf7fd8 execute
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1655
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 abc.c
int a, b;
int c(int *d, int *e) {
  for (; b;)
d = e;
  return d;
}
void f() {
  for (;;) {
int *g[1];
int h = 0;
for (; h < 3; h++)
  g[0] = &a;
&a == g[0] || i(c(g, g[0]));
  }
}

[Bug tree-optimization/87147] New: GCC miscompiles at -O3 on valid code

2018-08-29 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87147

Bug ID: 87147
   Summary: GCC miscompiles at -O3 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It miscompiles after r263959. Bisect points to r263875.



$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180829 (experimental) [trunk revision 263965] (GCC)


$ gcc-trunk  abc.c  ; ./a.out
$ gcc-trunk -O3 abc.c ; timeout -s 9 10 ./a.out
Killed


$ cat abc.c
short a;
long b;
int c, d, g;
char e, h;
long f[] = {0};
int main() {
  int i = 1;
  for (; a <= 3; a++) {
c = 0;
for (; c <= 2; c++) {
  b = 0;
  for (; b <= 3; b++) {
h = i && f[d];
e = g && i;
i = 0;
  }
}
  }
}

[Bug tree-optimization/87132] New: Gcc miscompiles at -O2 on valid code

2018-08-28 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87132

Bug ID: 87132
   Summary: Gcc miscompiles at -O2 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It seems to be a recent regression starting from r263875 (need double check).


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180828 (experimental) [trunk revision 263917] (GCC)




$ gcc-trunk abc.c ; ./a.out
0
$ gcc-trunk -O2 abc.c ; ./a.out
4


$ cat abc.c
int printf(const char *, ...);
int a, b;
short c;
char d;
int main() {
  int e[] = {4, 4, 4, 4, 4, 4, 4, 4, 4};
  d = 8;
  for (; d; d--) {
a = 0;
for (; a <= 8; a++) {
  c = e[1];
  e[d] = b;
}
  }
  printf("%d\n", c);
}

[Bug tree-optimization/87022] New: GCC miscompiles at -O3 on valid code

2018-08-19 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87022

Bug ID: 87022
   Summary: GCC miscompiles at -O3 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It also affects gcc-8.1 at -O3. gcc-7.3 works fine.

It appears that it starts at r253679.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180819 (experimental) [trunk revision 263651] (GCC)



$ gcc-trunk abc.c ; ./a.out > ref.txt
$ gcc-trunk -O3 abc.c ; ./a.out > a.txt
$ diff ref.txt a.txt
25,49c25,49
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
< 0
---
> 1
> 1
> 1
> 1
> 0
> 0
> 1
> 1
> 1
> 1
> 1
> 0
> 0
> 1
> 1
> 1
> 1
> 1
> 0
> 0
> 1
> 1
> 1
> 1
> 1
$ gcc-7.3 -O3 abc.c ; ./a.out > a.txt
$ diff ref.txt a.txt
$


$ cat abc.c
void printf();
char a[7];
char b[10][7];
short c;
int d, e, f, g;
int main() {
  for (; d <= 4; d++) {
e = 0;
for (; e <= 6; e++) {
  if (a[c])
b[e + 3][d + 2] = 1;
  a[0] = 5;
  b[e][d + 2] = 0;
}
  }
  for (; f < 10; f++) {
g = 0;
for (; g < 7; g++)
  printf("%d\n", b[f][g]);
  }
}

[Bug tree-optimization/86927] New: Gcc miscompiles at -O3 on valid code

2018-08-12 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86927

Bug ID: 86927
   Summary: Gcc miscompiles at -O3 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression. And it happens at -O3 only.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180812 (experimental) [trunk revision 263494] (GCC)


$ gcc-trunk abc.c ; ./a.out
$ gcc-trunk -O2 abc.c ; ./a.out
$ gcc-trunk -O3 abc.c ; ./a.out
Aborted (core dumped)


$ cat abc.c
int a[28];
int b;
void abort();
int main() {
  a[4] = 1;
  int c = 1;
  for (; b < 8; b++)
if (a[b])
  c = 0;
  if (c)
abort();
}

[Bug c++/86905] New: g++ ICE on valid code: verify_cgraph_node failed

2018-08-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86905

Bug ID: 86905
   Summary: g++ ICE on valid code: verify_cgraph_node failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression. g++-8.1 compiles.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180809 (experimental) [trunk revision 263445] (GCC)

$ g++-trunk abc.C
abc.C: In function ‘int pthread_equal()’:
abc.C:1:42: warning: no return statement in function returning non-void
[-Wreturn-type]
 extern "C" __inline int pthread_equal() {}
  ^
abc.C: At global scope:
abc.C:3:17: error: comdat-local function called by void b() outside its comdat
 void b() { a(); }
 ^
_ZL1av/1 (int a()) @0x7f1523464420
  Type: function definition analyzed alias transparent_alias weakref
  Visibility: weak comdat_group:pthread_equal
  Same comdat group as: pthread_equal/0
  References: pthread_equal/0 (alias)
  Referring:
  First run: 0
  Function flags:
  Called by: void b()/2 (can throw external)
  Calls:
abc.C:3:17: internal compiler error: verify_cgraph_node failed
0xaf69ec cgraph_node::verify_node()
../../gcc/gcc/cgraph.c:3433
0xaeae8c symtab_node::verify()
../../gcc/gcc/symtab.c:1218
0xaeaf57 symtab_node::verify_symtab_nodes()
../../gcc/gcc/symtab.c:1238
0xafe434 symtab_node::checking_verify_symtab_nodes()
../../gcc/gcc/cgraph.h:625
0xafe434 symbol_table::compile()
../../gcc/gcc/cgraphunit.c:2520
0xb00399 symbol_table::compile()
../../gcc/gcc/cgraphunit.c:2517
0xb00399 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2698
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 abc.C
extern "C" __inline int pthread_equal() {}
static __typeof(pthread_equal) a __attribute__((__weakref__("pthread_equal")));
void b() { a(); }

[Bug tree-optimization/86886] Gcc miscompiles at -O3 on valid code

2018-08-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86886

Qirun Zhang  changed:

   What|Removed |Added

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

--- Comment #5 from Qirun Zhang  ---
The programs in my bug report are invalid. I am closing this PR. Thanks for the
pointers.

[Bug tree-optimization/86886] Gcc miscompiles at -O3 on valid code

2018-08-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86886

--- Comment #2 from Qirun Zhang  ---
(In reply to Andrew Pinski from comment #1)
> I don't think this is a bug.  You are taking the address of a field of an
> union and accessing via that address.  This is not tracked at all.

Here is a reduced case without "union".

$ gcc-6.1 -O3 abc.c; ./a.out
0

$ gcc abc.c; ./a.out
0

$ gcc-8.1 -O3 abc.c; ./a.out
1

$ gcc-trunk -O3 abc.c; ./a.out
1

$ cat abc.c
void printf();
short b, c;
int e, d;
int *f = &e, *g = &d;
unsigned short **h = (unsigned short **)&f;
void i(int a) {
  *f = 0;
  for (; b;)
;
  c = **h;
  d = b = e ? (unsigned char)c : 0;
  *g = b;
}
int main() {
  **h = 1;
  i(6);
  printf("%d\n", c);
}

[Bug tree-optimization/86886] New: Gcc miscompiles at -O3 on valid code

2018-08-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86886

Bug ID: 86886
   Summary: Gcc miscompiles at -O3 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It also affects gcc-8.1 at -O3. gcc-6.1 works fine.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180807 (experimental) [trunk revision 263356] (GCC)



$ gcc-6.1 -O3 abc.c; ./a.out
0

$ gcc abc.c; ./a.out
0

$ gcc-8.1 -O3 abc.c; ./a.out
1

$ gcc-trunk -O3 abc.c; ./a.out
1


$ cat abc.c
void printf();
typedef int f;
short g, k, l, n;
union {
  int b;
  short c;
} h;
f d, e;
unsigned short *i = &h.c;
unsigned short **j = &i;
f *m = &d, *o = &h.b;
void p(f a) {
  *o = 0;
  for (; e;)
;
  n = **j;
  l = n;
  unsigned char aq = n;
  k = g == 0 ? aq : 0;
  *m = k;
}
int main() {
  **j = 1;
  p(6);
  printf("%d\n", d);
}

[Bug tree-optimization/86858] New: gcc ICE at -O3 in as_a, at is-a.h:197

2018-08-04 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86858

Bug ID: 86858
   Summary: gcc ICE at -O3 in as_a, at is-a.h:197
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression. gcc-8.1 compiles at -O3.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180804 (experimental) [trunk revision 263307] (GCC)


$ gcc-trunk -O3 abc.c
during GIMPLE pass: vect
abc.c: In function ‘h’:
abc.c:3:6: internal compiler error: in as_a, at is-a.h:197
 void h() {
  ^
0x6e2143 gphi* as_a(gimple*)
../../gcc/gcc/is-a.h:197
0x6e2143 vect_is_simple_reduction
../../gcc/gcc/tree-vect-loop.c:2859
0xef63b2 vect_force_simple_reduction(_loop_vec_info*, _stmt_vec_info*, bool*,
bool)
../../gcc/gcc/tree-vect-loop.c:3277
0xef63b2 vect_analyze_scalar_cycles_1
../../gcc/gcc/tree-vect-loop.c:560
0xf01e0f vect_analyze_scalar_cycles
../../gcc/gcc/tree-vect-loop.c:648
0xf01e0f vect_analyze_loop_2
../../gcc/gcc/tree-vect-loop.c:1855
0xf01e0f vect_analyze_loop(loop*, _loop_vec_info*, vec_info_shared*)
../../gcc/gcc/tree-vect-loop.c:2315
0xf1d8b0 try_vectorize_loop_1
../../gcc/gcc/tree-vectorizer.c:867
0xf1e6c5 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:1069
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 abc.c
int a, b, c, d;
char(e)(char f, char g) { return f + g; }
void h() {
  for (; c; ++c) {
d = 0;
for (; d != 8; d = e(d, 3)) {
  a = b && a;
  b = c;
}
  }
}

[Bug tree-optimization/86749] New: Gcc miscompiles at -O3 with sse4 on valid code

2018-07-30 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86749

Bug ID: 86749
   Summary: Gcc miscompiles at -O3 with sse4 on valid code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It seems to be a recent regression. gcc-8.1 correctly compiles.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180730 (experimental) [trunk revision 263066] (GCC) 



$ gcc-trunk -O3 -msse4 abc.c ; ./a.out
0

$ gcc-8.1 -O3 -msse4 abc.c ; ./a.out
4

$ gcc-trunk -O3 abc.c ; ./a.out
4


$ cat abc.c

void printf();
short a, b, f, g;
int c = 4, d, e = -1L;
long h = 4;
int main() {
  long i;
  for (; d <= 55; d++) {
g = c >= 2 ? 0 : b << c;
f = g - a;
i = (f ^ 9223372036854775807) < 0 ? f : h;
e &= i;
  }
  printf("%d\n", e);
}

[Bug c++/86663] New: g++ ICE with -std=c++11

2018-07-24 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86663

Bug ID: 86663
   Summary: g++ ICE with -std=c++11
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

With "-std=c++11", it affects g++ as early as 4.8. Clang could compile it.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180724 (experimental) [trunk revision 262942] (GCC) 


$ g++-trunk -std=c++11 abc.C
abc.C:2:7: internal compiler error: Segmentation fault
 a;
   ^
0xebf0cf crash_signal
../../gcc/gcc/toplev.c:325
0x98728c lookup_template_class_1
../../gcc/gcc/cp/pt.c:9618
0x98728c lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/gcc/cp/pt.c:9666
0x9b7b2d finish_template_type(tree_node*, tree_node*, int)
../../gcc/gcc/cp/semantics.c:3228
0x9360e4 cp_parser_template_id
../../gcc/gcc/cp/parser.c:15988
0x9361f3 cp_parser_class_name
../../gcc/gcc/cp/parser.c:22518
0x9428bf cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:6601
0x9428bf cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:6287
0x94b08e cp_parser_constructor_declarator_p
../../gcc/gcc/cp/parser.c:26669
0x94b08e cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13737
0x9507b0 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13058
0x9558b2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12903
0x955cad cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12779
0x955fa4 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4603
0x955fa4 c_parse_file()
../../gcc/gcc/cp/parser.c:39117
0xa51fe0 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1138
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.


$ g++-4.8 -std=c++11 abc.C
abc.C:2:7: internal compiler error: Segmentation fault
 a;
   ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Preprocessed source stored into /tmp/ccksnSsC.out file, please attach this to
your bugreport.
ERROR: Cannot create report: [Errno 17] File exists:
'/var/crash/_usr_lib_gcc_x86_64-linux-gnu_4.8_cc1plus.1000.crash'


$ cat abc.C
template  using a = a;
a;

[Bug c++/86661] New: g++ ICE:tree check: expected tree that contains ‘decl minimal’ structure, have ‘overload’ in note_name_declared_in_class, at cp/class.c:8288

2018-07-24 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86661

Bug ID: 86661
   Summary: g++ ICE:tree check: expected tree that contains ‘decl
minimal’ structure, have ‘overload’ in
note_name_declared_in_class, at cp/class.c:8288
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

clang++ could compile it. It appears to be a recent regression.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180724 (experimental) [trunk revision 262942] (GCC) 


$ g++-trunk abc.C
abc.C:5:31: internal compiler error: tree check: expected tree that contains
‘decl minimal’ structure, have ‘overload’ in note_name_declared_in_class, at
cp/class.c:8288
   template  void a();
   ^
0x78fc6e tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.c:9523
0x5e5d0c contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3228
0x5e5d0c note_name_declared_in_class(tree_node*, tree_node*)
../../gcc/gcc/cp/class.c:8288
0x90e2aa push_class_level_binding_1
../../gcc/gcc/cp/name-lookup.c:4656
0x90e2aa push_class_level_binding(tree_node*, tree_node*)
../../gcc/gcc/cp/name-lookup.c:4681
0x84d79d add_method(tree_node*, tree_node*, bool)
../../gcc/gcc/cp/class.c:1156
0x9b79e3 finish_member_declaration(tree_node*)
../../gcc/gcc/cp/semantics.c:3107
0x94fc67 cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:27113
0x95047e cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:27272
0x95047e cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:27291
0x93b9fd cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:23593
0x93c898 cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:23520
0x93c898 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22664
0x93e59d cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22926
0x93e59d cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16907
0x94b113 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13748
0x9507b0 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13058
0x9558b2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12903
0x955cad cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12779
0x9563fa cp_parser_namespace_body
../../gcc/gcc/cp/parser.c:18753
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 abc.C
typedef int a;
namespace {
class b {
  a c;
  template  void a();
};
}

[Bug c++/86426] New: g++ ICE at on valid code in tree_operand_check, at tree.h:3615

2018-07-06 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86426

Bug ID: 86426
   Summary: g++ ICE at on valid code in tree_operand_check, at
tree.h:3615
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It affects versions from 4.8 to trunk.
g++4.6 emits errors. But clang++ can compile.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180706 (experimental) [trunk revision 262476] (GCC)


$ g++-trunk abc.c
abc.c: In substitution of ‘template int {anonymous}::f1(X...) [with T = ]’:
abc.c:4:26:   required from here
abc.c:4:26: internal compiler error: tree check: expected class ‘expression’,
have ‘type’ (integer_type) in tree_operand_check, at tree.h:3615
 int a1 = f1(X());
  ^
0x78c90b tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9403
0x651e95 expr_check(tree_node*, char const*, int, char const*)
../../gcc/gcc/tree.h:3286
0x651e95 tree_operand_check(tree_node*, int, char const*, int, char const*)
../../gcc/gcc/tree.h:3615
0x651e95 unify_pack_expansion
../../gcc/gcc/cp/pt.c:21125
0x97665d unify
../../gcc/gcc/cp/pt.c:21919
0x9758b3 unify
../../gcc/gcc/cp/pt.c:22116
0x976612 unify
../../gcc/gcc/cp/pt.c:21913
0x974e92 try_class_unification
../../gcc/gcc/cp/pt.c:20907
0x9766b5 unify
../../gcc/gcc/cp/pt.c:21950
0x97bb93 unify_one_argument
../../gcc/gcc/cp/pt.c:20161
0x97c914 unify_pack_expansion
../../gcc/gcc/cp/pt.c:21156
0x97dce3 type_unification_real
../../gcc/gcc/cp/pt.c:20300
0x97ee7f fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
../../gcc/gcc/cp/pt.c:19660
0x826a02 add_template_candidate_real
../../gcc/gcc/cp/call.c:3212
0x827414 add_template_candidate
../../gcc/gcc/cp/call.c:3291
0x827414 add_candidates
../../gcc/gcc/cp/call.c:5532
0x827801 add_candidates
../../gcc/gcc/cp/call.c:4225
0x827801 perform_overload_resolution
../../gcc/gcc/cp/call.c:4233
0x829722 build_new_function_call(tree_node*, vec**, int)
../../gcc/gcc/cp/call.c:4306
0x9a0dad finish_call_expr(tree_node*, vec**, bool,
bool, int)
../../gcc/gcc/cp/semantics.c:2536
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 abc.c
template  struct X {};
namespace {
template  int f1(X...);
int a1 = f1(X());
}

[Bug c++/86397] New: g++ ICE at on valid code in nothrow_spec_p, at cp/except.c:1158

2018-07-03 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86397

Bug ID: 86397
   Summary: g++ ICE at on valid code in nothrow_spec_p, at
cp/except.c:1158
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

g++-6.1 compiles. g++-8.1 and the trunk version crash.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180703 (experimental) [trunk revision 262340] (GCC) 


$ g++-trunk abc.c
abc.c: In instantiation of ‘void f(int (*)() noexcept (e)) [with bool
 = false]’:
abc.c:3:29:   required from here
abc.c:2:22: internal compiler error: in nothrow_spec_p, at cp/except.c:1158
 template  void f(int() noexcept(e)) {}
  ^
0x615664 nothrow_spec_p(tree_node const*)
../../gcc/gcc/vec.h:972
0x9b91b7 canonical_eh_spec(tree_node*)
../../gcc/gcc/cp/tree.c:2598
0x8ddfdd canonicalize_for_substitution
../../gcc/gcc/cp/mangle.c:422
0x8ddfdd write_type
../../gcc/gcc/cp/mangle.c:2107
0x8dd9cc write_type
../../gcc/gcc/cp/mangle.c:2306
0x8df6f4 write_method_parms
../../gcc/gcc/cp/mangle.c:2799
0x8e564a write_bare_function_type
../../gcc/gcc/cp/mangle.c:2735
0x8e6534 mangle_decl_string
../../gcc/gcc/cp/mangle.c:3795
0x8e6a50 get_mangled_id
../../gcc/gcc/cp/mangle.c:3817
0x8e6a50 mangle_decl(tree_node*)
../../gcc/gcc/cp/mangle.c:3855
0x11172cd decl_assembler_name(tree_node*)
../../gcc/gcc/tree.c:691
0x115bd9f notice_global_symbol(tree_node*)
../../gcc/gcc/varasm.c:1675
0xadc8fa cgraph_node::finalize_function(tree_node*, bool)
../../gcc/gcc/cgraphunit.c:451
0x9a1c5f expand_or_defer_fn(tree_node*)
../../gcc/gcc/cp/semantics.c:4272
0x961483 instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:24084
0x9873d3 instantiate_pending_templates(int)
../../gcc/gcc/cp/pt.c:24179
0x8b0448 c_parse_final_cleanups()
../../gcc/gcc/cp/decl2.c:4707
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 abc.c
void e();
template  void f(int() noexcept(e)) {}
template void f(int());

[Bug c++/86216] New: g++ ICE on valid code: verify_ssa failed

2018-06-19 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86216

Bug ID: 86216
   Summary: g++ ICE on valid code: verify_ssa failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

g++8.1 emits yet another error...

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180619 (experimental) [trunk revision 261742] (GCC)



$ g++-trunk -c abc.c
abc.c: In lambda function:
abc.c:11:23: error: definition in block 2 follows the use
 int main() { b(2, 3); }
   ^
for SSA_NAME: _1 in statement:
_1 = _1 + 1;
during GIMPLE pass: ssa
abc.c:11:23: internal compiler error: verify_ssa failed
0x108c557 verify_ssa(bool, bool)
../../gcc/gcc/tree-ssa.c:1188
0xdcc8ad execute_function_todo
../../gcc/gcc/passes.c:1950
0xdcd6be execute_todo
../../gcc/gcc/passes.c:1997
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.


$ g++-8.1 abc.c
during RTL pass: expand
abc.c: In lambda function:
abc.c:7:5: internal compiler error: in expand_expr_real_1, at expr.c:10001
 n = sizeof(buffer1[n]);
 ^
0x5d5fbe expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-8.1.0/gcc/expr.c:9995
0x8e9202 expand_expr
../../gcc-8.1.0/gcc/expr.h:280
0x8e9202 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc-8.1.0/gcc/expr.c:8466
0x7e9151 expand_gimple_stmt_1
../../gcc-8.1.0/gcc/cfgexpand.c:3729
0x7e9151 expand_gimple_stmt
../../gcc-8.1.0/gcc/cfgexpand.c:3790
0x7ea0df expand_gimple_basic_block
../../gcc-8.1.0/gcc/cfgexpand.c:5819
0x7ef4e6 execute
../../gcc-8.1.0/gcc/cfgexpand.c:6425
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 abc.c
typedef int intptr_t;
template  void b(intptr_t n, T arg) {
  typedef intptr_t ArrTy[arg];
  ArrTy buffer2;
  ArrTy buffer1[arg];
  [&] {
n = sizeof(buffer1[n]);
[&] { n = sizeof(buffer2); }();
  }();
}
int main() { b(2, 3); }

[Bug c++/86171] New: g++ ICE on valid code: tree check: expected var_decl or function_decl, have type_decl in duplicate_decls, at cp/decl.c:2291

2018-06-15 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86171

Bug ID: 86171
   Summary: g++  ICE on valid code: tree check: expected var_decl
or function_decl, have type_decl in duplicate_decls,
at cp/decl.c:2291
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression.

g++-8.1 compiles. g++-4.8 also compiles with "-std=c++11"


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180615 (experimental) [trunk revision 261626] (GCC)




$ g++-trunk abc.c
abc.c: In substitution of ‘template using B = typename A::A [with T =
short int]’:
abc.c:4:8:   required from here
abc.c:2:46: internal compiler error: tree check: expected var_decl or
function_decl, have type_decl in duplicate_decls, at cp/decl.c:2291
 template  using B = typename A::A;
  ^
0x78a200 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9336
0x88f372 tree_check2(tree_node*, char const*, int, char const*, tree_code,
tree_code)
../../gcc/gcc/tree.h:3136
0x88f372 duplicate_decls(tree_node*, tree_node*, bool)
../../gcc/gcc/cp/decl.c:2291
0x951389 register_specialization
../../gcc/gcc/cp/pt.c:1625
0x96a81e tsubst_decl
../../gcc/gcc/cp/pt.c:13778
0x95efe7 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:14193
0x97b7f2 instantiate_template_1
../../gcc/gcc/cp/pt.c:19234
0x97b7f2 instantiate_template(tree_node*, tree_node*, int)
../../gcc/gcc/cp/pt.c:19290
0x95f38b instantiate_alias_template
../../gcc/gcc/cp/pt.c:19314
0x95f38b tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:14220
0x970637 lookup_template_class_1
../../gcc/gcc/cp/pt.c:9391
0x970637 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/gcc/cp/pt.c:9646
0x9a069d finish_template_type(tree_node*, tree_node*, int)
../../gcc/gcc/cp/semantics.c:3240
0x91e0a4 cp_parser_template_id
../../gcc/gcc/cp/parser.c:15943
0x91e1a8 cp_parser_class_name
../../gcc/gcc/cp/parser.c:22478
0x92a90f cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:6564
0x92a90f cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:6250
0x933509 cp_parser_constructor_declarator_p
../../gcc/gcc/cp/parser.c:26629
0x933509 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13694
0x938c7f cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13015
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 abc.c
template  struct A;
template  using B = typename A::A;
template  struct A { typedef B U; };
B b;

[Bug c++/86159] New: g++ ICE at -O1 and above on valid code: incorrect type of vector CONSTRUCTOR elements

2018-06-14 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86159

Bug ID: 86159
   Summary: g++ ICE at -O1 and above on valid code: incorrect type
of vector CONSTRUCTOR elements
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression.

It happens at "-O1" and above but g++-trunk compiles. g++-8.1 also compiles at
"-O1" and above.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180614 (experimental) [trunk revision 261591] (GCC) 


$ g++-8.1 abc.c -c -O1
$ g++-trunk abc.c -c -O1
abc.c: In function ‘vec fn1()’:
abc.c:2:9: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
 vec fn1() {
 ^
abc.c:2:5: error: incorrect type of vector CONSTRUCTOR elements
 vec fn1() {
 ^~~
{_7, _10, _13, _16, _19, _22, _25, _28}

_1 = {_7, _10, _13, _16, _19, _22, _25, _28};
during GIMPLE pass: veclower2
abc.c:2:5: internal compiler error: verify_gimple failed
0xee2941 verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5405
0xdccf7f execute_function_todo
../../gcc/gcc/passes.c:1943
0xdcde8e execute_todo
../../gcc/gcc/passes.c:1997
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 abc.c
typedef int vec __attribute__((vector_size(32)));
vec fn1() {
  vec x, zero{};
  vec one = zero + 1;
  return x < zero ? one : zero;
}

[Bug rtl-optimization/86104] New: gcc ICE at -O1 on x86_64-linux-gnu in "plus_constant", at explow.c:103

2018-06-10 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86104

Bug ID: 86104
   Summary: gcc ICE at -O1 on x86_64-linux-gnu in "plus_constant",
at explow.c:103
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens at 32-bit mode only.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180610 (experimental) [trunk revision 261387] (GCC)


$ gcc-trunk -m32 -O1 abc.c
during RTL pass: dse1
abc.c: In function ‘times_two’:
abc.c:16:1: internal compiler error: in plus_constant, at explow.c:103
 }
 ^
0x61289b plus_constant(machine_mode, rtx_def*, poly_int<1u, long>, bool)
../../gcc/gcc/explow.c:103
0x13e5e47 record_store
../../gcc/gcc/dse.c:1505
0x13e6a92 scan_insn
../../gcc/gcc/dse.c:2548
0x13e7912 dse_step1
../../gcc/gcc/dse.c:2660
0x13e7912 rest_of_handle_dse
../../gcc/gcc/dse.c:3577
0x13e7912 execute
../../gcc/gcc/dse.c:3635
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 abc.c
 int __RTL (startwith ("vregs")) times_two (int i)
{
(function ""
 (param "i"
  (DECL_RTL (mem(plus) [0  ]))
  (DECL_RTL_INCOMING (reg di ))
 ) (insn-chain
(block 2
 (edge-from entry )
 (cnote 4 [bb 2] NOTE_INSN_BASIC_BLOCK)
 (cinsn 2 (set (mem:SI (plus:DI (reg virtual-stack-vars)
(const_int 4)) [1 i+A32])
   (reg:SI di )) )
 (edge-to exit (flags "FALLTHRU"))
) ) )
}

[Bug c++/86063] New: g++ ICE at tree check: expected tree_list, have expr_pack_expansion in cp_check_const_attributes, at cp/decl2.c:1391

2018-06-05 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86063

Bug ID: 86063
   Summary: g++ ICE at  tree check: expected tree_list, have
expr_pack_expansion in cp_check_const_attributes, at
cp/decl2.c:1391
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression.

g++-7.3 compiles.






$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180604 (experimental) [trunk revision 261145] (GCC) 


$ g++-trunk abc.cpp
abc.cpp:1:64: internal compiler error: tree check: expected tree_list, have
expr_pack_expansion in cp_check_const_attributes, at cp/decl2.c:1391
 template  struct A2 { [[gnuA(alignof(T))...]] char t; };
^
0x798b88 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9338
0x6127bf tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3135
0x6127bf cp_check_const_attributes
../../gcc/gcc/cp/decl2.c:1391
0x6127bf cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/gcc/cp/decl2.c:1509
0x8bcbed grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/gcc/cp/decl2.c:967
0x9327cd cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:24017
0x933828 cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:23496
0x933828 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22640
0x935649 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22902
0x935649 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16883
0x94282c cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13721
0x946f45 cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:27319
0x9472cc cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:27011
0x947b6e cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:27248
0x947b6e cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:27267
0x94d0d9 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12825
0x94d3ad cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12752
0x94d6a4 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4574
0x94d6a4 c_parse_file()
../../gcc/gcc/cp/parser.c:39132
0xa4a7c6 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1133
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 abc.cpp
template  struct A2 { [[gnuA(alignof(T))...]] char t; };

[Bug c++/86060] New: g++ ICE at on with "c++03" in tsubst_copy, at cp/pt.c:15459

2018-06-05 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86060

Bug ID: 86060
   Summary: g++ ICE at on with "c++03" in tsubst_copy, at
cp/pt.c:15459
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The trunk version g++ crashes with "-std=c++98" or "-std=c++03". The other std
flags seem working.

It seems to be a regression in 5.X. Gcc-4.9 works fine.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180604 (experimental) [trunk revision 261145] (GCC)



$ g++-trunk -std=c++11 -c abc.cpp

$ g++-trunk -std=c++98 -c abc.cpp
abc.cpp: In function ‘void foo(T (&)[8])’:
abc.cpp:2:16: warning: range-based ‘for’ loops only available with -std=c++11
or -std=gnu++11
   for (int i : a)
^
abc.cpp: In instantiation of ‘void foo(T (&)[8]) [with T = int]’:
abc.cpp:5:22:   required from here
abc.cpp:3:5: internal compiler error: in tsubst_copy, at cp/pt.c:15459
 i;
 ^
0x64601c tsubst_copy
../../gcc/gcc/cp/pt.c:15457
0x968c43 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:18862
0x974ab7 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:17415
0x9727c6 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16616
0x97251d tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16811
0x971bbf tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16899
0x971517 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16587
0x971517 instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:24001
0x997023 instantiate_pending_templates(int)
../../gcc/gcc/cp/pt.c:24117
0x8be968 c_parse_final_cleanups()
../../gcc/gcc/cp/decl2.c:4703
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 abc.cpp
template  void foo(T (&a)[8]) {
  for (int i : a)
i;
}
void fn1() { foo; }

[Bug tree-optimization/85615] New: ICE at -O2 and above on valid code on x86_64-linux-gnu: in dfs_enumerate_from, at cfganal.c:1197

2018-05-02 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85615

Bug ID: 85615
   Summary: ICE at -O2 and above on valid code on
x86_64-linux-gnu: in dfs_enumerate_from, at
cfganal.c:1197
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

As the title. 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180502 (experimental) [trunk revision 259838] (GCC)



$ gcc-trunk -O2 abc.c
during GIMPLE pass: vrp
abc.c: In function ‘fn1’:
abc.c:3:6: internal compiler error: in dfs_enumerate_from, at cfganal.c:1197
 void fn1() {
  ^~~
0x5fc743 dfs_enumerate_from(basic_block_def*, int, bool (*)(basic_block_def
const*, void const*), basic_block_def**, int, void const*)
../../gcc/gcc/cfganal.c:1197
0xe97e21 determine_bb_domination_status(loop*, basic_block_def*)
../../gcc/gcc/tree-ssa-threadupdate.c:1501
0xe9a541 thread_through_loop_header
../../gcc/gcc/tree-ssa-threadupdate.c:1648
0xe9a541 thread_through_all_blocks(bool)
../../gcc/gcc/tree-ssa-threadupdate.c:2391
0xf2ddb5 execute_vrp
../../gcc/gcc/tree-vrp.c:7050
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 abc.c
long a, d;
int b, c;
void fn1() {
  int e = -1L, f = 2, g = 8;
  for (;;) {
for (; b; g++)
  ;
int i;
for (; c;) {
  i = 5;
  for (; e >= 1; i--)
;
}
d = f ?: a;
if (d) {
  e = 0;
  for (; i;)
for (; g < 3; f++)
  ;
}
  }
}

[Bug tree-optimization/84929] New: ICE at -O3 on valid code on x86_64-linux-gnu: tree check: expected polynomial_chrec, have nop_expr in analyze_siv_subscript_cst_affine, at tree-data-ref.c:3018

2018-03-17 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84929

Bug ID: 84929
   Summary: ICE at -O3 on valid code on x86_64-linux-gnu: tree
check: expected polynomial_chrec, have nop_expr in
analyze_siv_subscript_cst_affine, at
tree-data-ref.c:3018
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens at -O3. "-O2" works fine.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.1 20180317 (experimental) [trunk revision 258620] (GCC)


$ gcc-trunk -O3 abc.c
during GIMPLE pass: pcom
abc.c: In function ‘fn1’:
abc.c:2:6: internal compiler error: tree check: expected polynomial_chrec, have
nop_expr in analyze_siv_subscript_cst_affine, at tree-data-ref.c:3018
 void fn1() {
  ^~~
0x6f05ca tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9322
0x76fe1b analyze_siv_subscript_cst_affine
../../gcc/gcc/tree.h:3135
0x1514588 analyze_siv_subscript
../../gcc/gcc/tree-data-ref.c:3898
0x1514588 analyze_overlapping_iterations
../../gcc/gcc/tree-data-ref.c:4153
0x1514588 subscript_dependence_tester_1
../../gcc/gcc/tree-data-ref.c:4694
0x1514a37 subscript_dependence_tester_1
../../gcc/gcc/tree-data-ref.c:4690
0x1514a37 subscript_dependence_tester
../../gcc/gcc/tree-data-ref.c:4744
0x1514a37 compute_affine_dependence(data_dependence_relation*, loop*)
../../gcc/gcc/tree-data-ref.c:4803
0x151661c compute_all_dependences(vec,
vec*, vec,
bool)
../../gcc/gcc/tree-data-ref.c:4870
0x1516e0a compute_data_dependences_for_loop(loop*, bool, vec*, vec*,
vec*)
../../gcc/gcc/tree-data-ref.c:5269
0xd7d589 tree_predictive_commoning_loop
../../gcc/gcc/tree-predcom.c:3190
0xd805dd tree_predictive_commoning()
../../gcc/gcc/tree-predcom.c:3312
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 abc.c
int a[4];
void fn1() {
  unsigned long b = 7818038963515661296;
  for (;; b++)
a[0xA699ECD2C348A3A0] = a[b];
}

[Bug tree-optimization/84427] New: gcc ICE at -O3 on x86_64-linux-gnu in compute_antic, at tree-ssa-pre.c:2356

2018-02-16 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84427

Bug ID: 84427
   Summary: gcc ICE at -O3 on x86_64-linux-gnu in compute_antic,
at tree-ssa-pre.c:2356
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

Level "-O2" works fine.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.1 20180216 (experimental) [trunk revision 257735] (GCC) 



$ gcc-trunk -O3 -c abc.c
abc.c: In function ‘fn1’:
abc.c:5:14: warning: implicit declaration of function ‘fn2’; did you mean
‘fn1’? [-Wimplicit-function-declaration]
 void fn1() { fn2(e, a); }
  ^~~
  fn1
during GIMPLE pass: pre
abc.c:5:6: internal compiler error: in compute_antic, at tree-ssa-pre.c:2356
 void fn1() { fn2(e, a); }
  ^~~
0x6cc6ff compute_antic
../../gcc/gcc/tree-ssa-pre.c:2356
0x6cc6ff execute
../../gcc/gcc/tree-ssa-pre.c:4114
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 abc.c
short a, d, e;
unsigned char b;
int c, f;
char g, h;
void fn1() { fn2(e, a); }
int fn2(int p1, int p2) {
l1:
  b = a;
  for (; h; h--)
if (p1)
  g = p2 * c;
else {
  c = d;
  if (f)
goto l1;
}
}

[Bug tree-optimization/82875] ICE at -Os on valid code on x86_64-linux-gnu: in find_widening_optab_handler_and_mode, at optabs-query.c:414

2017-11-06 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82875

--- Comment #2 from Qirun Zhang  ---
(In reply to Arseny Solokha from comment #1)
> This is likely a duplicate of PR82816.

Hi Arseny, I tried it on r254484. It still exists.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20171107 (experimental) [trunk revision 254484] (GCC)

$ gcc-trunk -m32 -Os a.c
during RTL pass: expand
a.c: In function ‘fn1’:
a.c:15:25: internal compiler error: in find_widening_optab_handler_and_mode, at
optabs-query.c:414
   d ? (a %= c) * (e *= a ? f : b) : 0;
 ^~
0xb9b285 find_widening_optab_handler_and_mode(optab_tag, machine_mode,
machine_mode, machine_mode*)
../../gcc/gcc/optabs-query.c:414
0xb8ea4a expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../gcc/gcc/optabs.c:1152
0xb92030 expand_doubleword_mult
../../gcc/gcc/optabs.c:865
0xb8fc38 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../gcc/gcc/optabs.c:1705
0x9661b5 expand_mult(machine_mode, rtx_def*, rtx_def*, rtx_def*, int)
../../gcc/gcc/expmed.c:3427
0x98b374 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/gcc/expr.c:8802
0x8653b1 expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.c:3712
0x8653b1 expand_gimple_stmt
../../gcc/gcc/cfgexpand.c:3773
0x866a18 expand_gimple_basic_block
../../gcc/gcc/cfgexpand.c:5774
0x86b796 execute
../../gcc/gcc/cfgexpand.c:6375
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/82875] New: ICE at -Os on valid code on x86_64-linux-gnu: in find_widening_optab_handler_and_mode, at optabs-query.c:414

2017-11-06 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82875

Bug ID: 82875
   Summary: ICE at -Os on valid code on x86_64-linux-gnu: in
find_widening_optab_handler_and_mode, at
optabs-query.c:414
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens at -Os and in 32-bit mode only.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20171106 (experimental) [trunk revision 254453] (GCC)



$ gcc-trunk -m32 -Os abc.c
during RTL pass: expand
abc.c: In function ‘fn1’:
abc.c:15:25: internal compiler error: in find_widening_optab_handler_and_mode,
at optabs-query.c:414
   d ? (a %= c) * (e *= a ? f : b) : 0;
 ^~
0xb9b215 find_widening_optab_handler_and_mode(optab_tag, machine_mode,
machine_mode, machine_mode*)
../../gcc/gcc/optabs-query.c:414
0xb8e9da expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../gcc/gcc/optabs.c:1152
0xb91fc0 expand_doubleword_mult
../../gcc/gcc/optabs.c:865
0xb8fbc8 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../gcc/gcc/optabs.c:1705
0x966155 expand_mult(machine_mode, rtx_def*, rtx_def*, rtx_def*, int)
../../gcc/gcc/expmed.c:3427
0x98b314 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/gcc/expr.c:8802
0x865371 expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.c:3712
0x865371 expand_gimple_stmt
../../gcc/gcc/cfgexpand.c:3773
0x8669d8 expand_gimple_basic_block
../../gcc/gcc/cfgexpand.c:5774
0x86b756 execute
../../gcc/gcc/cfgexpand.c:6375
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 abc.c
char a;
unsigned b;
long c, d;
long long e;
void fn1() {
  short f = a = 6;
  for (; 4 <= 3;)
for (; a <= 7;) {
  for (;;)
;
l1:
  for (; c <= 73;)
;
  e = 20;
  d ? (a %= c) * (e *= a ? f : b) : 0;
}
  goto l1;
}

[Bug tree-optimization/82765] New: ICE at -Os on valid code on x86_64-linux-gnu: in tree_to_shwi, at tree.c:6611

2017-10-28 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82765

Bug ID: 82765
   Summary: ICE at -Os on valid code on x86_64-linux-gnu: in
tree_to_shwi, at tree.c:6611
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens at -Os and in 64-bit mode only.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20171028 (experimental) [trunk revision 254197] (GCC) 



$ gcc-trunk -Os abc.c
abc.c: In function ‘main’:
abc.c:2:26: warning: initialization of ‘int *’ from incompatible pointer type
‘int (*)[1]’ [-Wincompatible-pointer-types]
 int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }
  ^
abc.c:2:26: note: (near initialization for ‘b[0]’)
abc.c:2:31: warning: integer constant is too large for its type
 int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }
   ^
abc.c:2:59: warning: initialization of ‘int *’ from incompatible pointer type
‘int (*)[1]’ [-Wincompatible-pointer-types]
 int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }
   ^
abc.c:2:59: note: (near initialization for ‘b[2]’)
abc.c:2:62: warning: initialization of ‘int *’ from incompatible pointer type
‘int (*)[1]’ [-Wincompatible-pointer-types]
 int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }
  ^
abc.c:2:62: note: (near initialization for ‘b[3]’)
abc.c:2:65: warning: initialization of ‘int *’ from incompatible pointer type
‘int (*)[1]’ [-Wincompatible-pointer-types]
 int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }
 ^
abc.c:2:65: note: (near initialization for ‘b[4]’)
abc.c:2:19: internal compiler error: in tree_to_shwi, at tree.c:6611
 int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }
   ^
0xec4467 tree_to_shwi(tree_node const*)
../../gcc/gcc/tree.c:6611
0xf1c62d decode_addr_const
../../gcc/gcc/varasm.c:2897
0xf1d807 const_hash_1
../../gcc/gcc/varasm.c:3038
0xf1d90e const_hash_1
../../gcc/gcc/varasm.c:3068
0xf1da1b const_hash_1
../../gcc/gcc/varasm.c:3028
0xf1dc42 tree_output_constant_def(tree_node*)
../../gcc/gcc/varasm.c:3545
0xa4d1ff gimplify_init_constructor
../../gcc/gcc/gimplify.c:4801
0xa4e134 gimplify_modify_expr_rhs
../../gcc/gcc/gimplify.c:5128
0xa4e779 gimplify_modify_expr
../../gcc/gcc/gimplify.c:5471
0xa412e9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11334
0xa44248 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6550
0xa48283 gimplify_and_add(tree_node*, gimple**)
../../gcc/gcc/gimplify.c:440
0xa48283 gimplify_decl_expr
../../gcc/gcc/gimplify.c:1681
0xa403f2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11530
0xa44248 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6550
0xa452ee gimplify_bind_expr
../../gcc/gcc/gimplify.c:1292
0xa411e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11534
0xa44248 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6550
0xa3fcc3 gimplify_statement_list
../../gcc/gcc/gimplify.c:1734
0xa3fcc3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11762
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 abc.c
int a[1][1];
int main() { int *b[] = {a, a[1820408606019012862278468], a, a, a}; }

[Bug tree-optimization/82669] New: ICE at -Os on valid code on x86_64-linux-gnu: in bitmap_check_index, at sbitmap.h:105

2017-10-22 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82669

Bug ID: 82669
   Summary: ICE at -Os on valid code on x86_64-linux-gnu: in
bitmap_check_index, at sbitmap.h:105
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens at -Os and in 32-bit mode only.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20171022 (experimental) [trunk revision 253982] (GCC)






$ gcc-trunk -m32 -Os abc.c
during RTL pass: reload
abc.c: In function ‘fn1’:
abc.c:16:1: internal compiler error: in bitmap_check_index, at sbitmap.h:105
 }
 ^
0xb4a77b bitmap_check_index
../../gcc/gcc/sbitmap.h:105
0xb4a77b bitmap_set_bit
../../gcc/gcc/sbitmap.h:132
0xb4a77b remove_some_program_points_and_update_live_ranges
../../gcc/gcc/lra-lives.c:1082
0xb4a77b compress_live_ranges
../../gcc/gcc/lra-lives.c:1209
0xb4a77b lra_create_live_ranges_1
../../gcc/gcc/lra-lives.c:1357
0xb4a95f lra_create_live_ranges(bool, bool)
../../gcc/gcc/lra-lives.c:1369
0xb2d963 lra(_IO_FILE*)
../../gcc/gcc/lra.c:2428
0xae5781 do_reload
../../gcc/gcc/ira.c:5446
0xae5781 execute
../../gcc/gcc/ira.c:5630
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 abc.c
int a, b;
void fn1() {
  for (;;) {
int i, j;
for (; i < 4; b++)
  for (; j < 8; a++)
;
{
  for (; b;) {
a = 0;
for (;;)
  ;
  }
}
  }
}

[Bug tree-optimization/82389] New: ICE on valid code on x86_64-linux-gnu: Segmentation fault

2017-10-02 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82389

Bug ID: 82389
   Summary: ICE on valid code on x86_64-linux-gnu: Segmentation
fault
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It crashes at level -O3. Level -O2 works fine.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20171001 (experimental) [trunk revision 253328] (GCC)



$ gcc-trunk -O3 -c abc.c
during GIMPLE pass: dse
abc.c: In function ‘fn1’:
abc.c:1:6: internal compiler error: Segmentation fault
 void fn1() {
  ^~~
0xd46f2f crash_signal
../../gcc/gcc/toplev.c:326
0x1473d19 bitmap_bit_in_range_p(simple_bitmap_def const*, unsigned int,
unsigned int)
../../gcc/gcc/sbitmap.c:348
0x707f7f live_bytes_read
../../gcc/gcc/tree-ssa-dse.c:496
0x707f7f dse_classify_store
../../gcc/gcc/tree-ssa-dse.c:594
0xe2b95b dse_dom_walker::dse_optimize_stmt(gimple_stmt_iterator*)
../../gcc/gcc/tree-ssa-dse.c:785
0x708ac5 dse_dom_walker::before_dom_children(basic_block_def*)
../../gcc/gcc/tree-ssa-dse.c:852
0x1366d17 dom_walker::walk(basic_block_def*)
../../gcc/gcc/domwalk.c:308
0xe2b213 execute
../../gcc/gcc/tree-ssa-dse.c:906
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 abc.c
void fn1() {
  short a[5];
  int b = 3004363298;
  for (; b < 5; b++)
a[b] = 0;
  fn1(a[3]);
}

[Bug tree-optimization/82166] New: gcc ICE at -Os on valid code on x86_64-linux-gnu in "ix86_finalize_stack_frame_flags"

2017-09-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82166

Bug ID: 82166
   Summary: gcc ICE at -Os on valid code on x86_64-linux-gnu in
"ix86_finalize_stack_frame_flags"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20170909 (experimental) [trunk revision 251936] (GCC)



$ gcc-trunk -Os -m32 abc.c
abc.c:1:6: warning: conflicting types for built-in function ‘printf’
[-Wbuiltin-declaration-mismatch]
 void printf();
  ^~
during RTL pass: pro_and_epilogue
abc.c: In function ‘main’:
abc.c:9:1: internal compiler error: in ix86_finalize_stack_frame_flags, at
config/i386/i386.c:14271
 }
 ^
0x7ada6c ix86_finalize_stack_frame_flags
../../gcc/gcc/config/i386/i386.c:14271
0xfc71fb ix86_expand_epilogue(int)
../../gcc/gcc/config/i386/i386.c:15414
0x11b7b8f gen_epilogue()
../../gcc/gcc/config/i386/i386.md:12700
0xfaae48 target_gen_epilogue
../../gcc/gcc/config/i386/i386.md:12211
0xae15e8 make_epilogue_seq
../../gcc/gcc/function.c:5864
0xae16fc thread_prologue_and_epilogue_insns()
../../gcc/gcc/function.c:5946
0xae1dc2 rest_of_handle_thread_prologue_and_epilogue
../../gcc/gcc/function.c:6436
0xae1dc2 execute
../../gcc/gcc/function.c:6478
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 abc.c
void printf();
int a, b, c;
int main() {
  int j;
  for (; c;)
a = b;
  for (; j;)
printf();
}

[Bug c/82050] New: ICE on invalid code on x86_64-linux-gnu in column_range, at diagnostic-show-locus.c:1403

2017-08-30 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82050

Bug ID: 82050
   Summary: ICE on invalid code on x86_64-linux-gnu in
column_range, at diagnostic-show-locus.c:1403
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The testcase is a bit large.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20170830 (experimental) [trunk revision 251530] (GCC)


$ gcc-trunk abc.c

abc.c:14:58: internal compiler error: in column_range, at
diagnostic-show-locus.c:1403
  unsigned long long
int var_257 = (unsigned long long int) (((8105967947593530303L) | 0) <<
7049221881134420491ULL) * ((unsigned long long int) (0 ((signed char) 0)) *
((unsigned long long int) (~((8866130261576365991L) / ((long int) (0
(var_255))) * unsigned long long int) ((var_253) * (var_83))) *
(((13003573118678480506ULL) * ((unsigned long long int)
(7295088625879320774L))) * ((unsigned long long int) (!((int)
(struct_obj_5.member_1_5)) * (unsigned long long int) ((int)
(struct_obj_5.member_1_6))) * (struct_obj_2.member_1_5)) * (((unsigned long
long int) ((int) (var_130))) * (struct_obj_2.member_1_5))) * unsigned long
long int) ((int) (var_252))) * (struct_obj_1.member_1_0)) * (((unsigned
long long int) (struct_obj_3.member_1_4)) & (struct_obj_4.member_1_5)) &
(((unsigned long long int) (struct_obj_3.member_1_2)) &
(12929547516806536054ULL))) & ((unsigned long long int) ((long int)
(struct_obj_1.member_1_4 & (((~(var_128)) & ((var_128) ^
(struct_obj_3.member_1_5))) | ((unsigned long long int) ((int) ((signed char)
((var_253) & ((unsigned long long int) (struct_obj_3.member_1_3 ^
(((unsigned long long int) ((long int) (((long int) ((int) ((signed char)
(-113 & ((162326598973762782L) & ((long int) ((int) (var_255))) ^
(((unsigned long long int) ((long int) (((long int) ((int) (115))) ^
(struct_obj_4.member_1_3 & (((struct_obj_2.member_1_0) |
(2855696530460496134ULL)) & ((unsigned long long int) (~(var_129 <<
((unsigned long long int) (struct_obj_1.member_1_3)) ^
(struct_obj_6.member_1_1)) << int) 0) | ((int) 0)) - (68))) -
(13835058055282163711ULL)) - (1ULL == ((unsigned long long int) ((int)
int) 7049221881134420491ULL) * ((unsigned long long int) ((int)
((signed char) ((var_254) / (var_254)) * ((unsigned long long int)
(~((8866130261576365991L) / ((long int) ((int) (var_255))) * unsigned
long long int) ((var_253) * (var_257))) * (((13003573118678480506ULL) *
((unsigned long long int) (7295088625879320774L))) * ((unsigned long long int)
(!((int) (struct_obj_5.member_1_5)) * (unsigned long long int) ((int)
(struct_obj_5.member_1_6))) * (struct_obj_2.member_1_5)) * (((unsigned long
long int) ((int) (var_252))) * (struct_obj_2.member_1_5))) * unsigned long
long int) ((int) (var_255))) * (struct_obj_1.member_1_0)) * (((unsigned
long long int) (struct_obj_3.member_1_4)) & (struct_obj_4.member_1_5)) &
(((unsigned long long int) (struct_obj_3.member_1_2)) &
(12929547516806536054ULL))) & ((unsigned long long int) ((long int)
(struct_obj_1.member_1_4 & (((~(var_257)) & ((var_128) ^
(struct_obj_3.member_1_5))) | ((unsigned long long int) ((int) ((signed char)
((var_256) & ((unsigned long long int) (struct_obj_3.member_1_3 ^
(((unsigned long long int) ((long int) (((long int) ((int) ((signed char)
(-113 & ((162326598973762782L) & ((long int) ((int) (var_255))) ^
(((unsigned long long int) ((long int) (((long int) ((int) (115))) ^
(struct_obj_4.member_1_3 & (((struct_obj_2.member_1_0) |
(2855696530460496134ULL)) & ((unsigned long long int) (~(var_254 &&
((int) (((unsigned long long int) (-(var_129))) == (((unsigned long long
int) (struct_obj_3.member_1_4)) & (struct_obj_4.member_1_5)) & (((unsigned long
long int) (struct_obj_3.member_1_2)) & (12929547516806536054ULL))) & ((unsigned
long long int) ((long int) (struct_obj_1.member_1_4 & (((~(var_256)) &
((var_84) ^ (struct_obj_3.member_1_5))) | ((unsigned long long int) ((int)
((signed char) ((var_83) & ((unsigned long long int)
(struct_obj_3.member_1_3 ^ (((unsigned long long int) ((long int)
(((long int) ((int) ((signed char) (-113 & ((162326598973762782L) & ((long
int) (

[Bug tree-optimization/81511] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in operator[], at vec.h:749

2017-07-21 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81511

Bug ID: 81511
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
operator[], at vec.h:749
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu.


$ gcc-trunk --version
gcc-trunk (GCC) 8.0.0 20170721 (experimental) [trunk revision 250425]

$ gcc-trunk -O3 abc.c
during GIMPLE pass: vect
abc.c: In function ‘fn1’:
abc.c:3:6: internal compiler error: in operator[], at vec.h:749
 void fn1() {
  ^~~
0x7624ac vec<_stmt_vec_info*, va_heap, vl_embed>::operator[](unsigned int)
../../gcc/gcc/vec.h:749
0x7624ac vec<_stmt_vec_info*, va_heap, vl_ptr>::operator[](unsigned int)
../../gcc/gcc/vec.h:1234
0x7624ac vinfo_for_stmt
../../gcc/gcc/tree-vectorizer.h:800
0x765cc4 vinfo_for_stmt
../../gcc/gcc/tree-vect-loop.c:3165
0x765cc4 vect_is_simple_reduction
../../gcc/gcc/tree-vect-loop.c:3072
0xee2884 vect_force_simple_reduction(_loop_vec_info*, gimple*, bool*, bool)
../../gcc/gcc/tree-vect-loop.c:3298
0xee2cd7 vect_analyze_scalar_cycles_1
../../gcc/gcc/tree-vect-loop.c:857
0xee4d4c vect_analyze_scalar_cycles
../../gcc/gcc/tree-vect-loop.c:934
0xee4d4c vect_analyze_loop_2
../../gcc/gcc/tree-vect-loop.c:1930
0xee4d4c vect_analyze_loop(loop*, _loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:2405
0xef0bb2 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:669
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 abc.c
int a, b, d, e;
char c, f;
void fn1() {
  for (; b; b = b + 5) {
e = a;
a = 1 | d;
d = f < 0 ^ c;
  }
}

[Bug tree-optimization/81192] New: gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-06-23 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

Bug ID: 81192
   Summary: gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-Os on x86_64-linux-gnu in both 32- and 64-bit modes. 


$ gcc-trunk --version
gcc-trunk (GCC) 8.0.0 20170623 (experimental) [trunk revision 249588]


$ gcc-trunk -Os abc.c
during GIMPLE pass: pre
abc.c: In function ‘fn2’:
abc.c:4:6: internal compiler error: Segmentation fault
 void fn2() {
  ^~~
0xc8a4cf crash_signal
../../gcc/gcc/toplev.c:338
0xe56285 same_succ_flush_bb
../../gcc/gcc/tree-ssa-tail-merge.c:813
0xe580cb same_succ_flush_bbs
../../gcc/gcc/tree-ssa-tail-merge.c:828
0xe580cb update_worklist
../../gcc/gcc/tree-ssa-tail-merge.c:875
0xe580cb tail_merge_optimize(unsigned int)
../../gcc/gcc/tree-ssa-tail-merge.c:1792
0xe06bf0 execute
../../gcc/gcc/tree-ssa-pre.c:5162
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 abc.c
unsigned a;
int b, c;
int(fn1)(int p1, int p2) { return p1 > 2147483647 - p2 ? p1 : p1 + p2; }
void fn2() {
  int j;
  a = 30;
  for (; a;)
for (; c; b = fn1(j, 1))
  ;
}

[Bug tree-optimization/80842] New: gcc ICE at -O3 on x86_64-linux-gnu in "set_lattice_value"

2017-05-20 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80842

Bug ID: 80842
   Summary: gcc ICE at -O3 on x86_64-linux-gnu in
"set_lattice_value"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O3 on x86_64-linux-gnu in both 32- and 64-bit modes. 



$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20170520 (experimental) [trunk revision 248308] (GCC)

$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn3’:
abc.c:10:6: internal compiler error: in set_lattice_value, at
tree-ssa-ccp.c:505
 void fn3() {
  ^~~
0xc9efc8 set_lattice_value
../../gcc/gcc/tree-ssa-ccp.c:505
0xca3f2c visit_assignment
../../gcc/gcc/tree-ssa-ccp.c:2322
0xca40da ccp_visit_stmt
../../gcc/gcc/tree-ssa-ccp.c:2396
0xd2f518 simulate_stmt
../../gcc/gcc/tree-ssa-propagate.c:241
0xd30fb2 process_ssa_edge_worklist
../../gcc/gcc/tree-ssa-propagate.c:341
0xd30fb2 ssa_propagate(ssa_prop_result (*)(gimple*, edge_def**, tree_node**),
ssa_prop_result (*)(gphi*))
../../gcc/gcc/tree-ssa-propagate.c:813
0xc9de10 do_ssa_ccp
../../gcc/gcc/tree-ssa-ccp.c:2436
0xc9de10 execute
../../gcc/gcc/tree-ssa-ccp.c:2480
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 abc.c
unsigned a;
short b;
char c, d, e;
void fn1();
void fn2() {
  a++;
  for (; a;)
fn1(0, 0);
}
void fn3() {
  fn2();
l1:;
  unsigned char f;
  short g;
  unsigned char *h = &f;
  g += &h ? e ? g = 1 : 0 : 0;
  d = g;
  c *f;
  if (d & (b %= *h) < f * d / (d -= 0))
goto l1;
}

[Bug ipa/80581] [8 Regression] ICE: in estimate_node_size_and_time, at ipa-inline-analysis.c:3425

2017-05-01 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80581

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #3 from Qirun Zhang  ---
The following smaller code also crashes the current trunk version of gcc.

It occurs only at -O2 and -O3 in 32-bit mode.

It also starts with r247417. I thought it should be a duplicate. Therefore, I
report it here.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20170501 (experimental) [trunk revision 247436] (GCC)


$ gcc-trunk -m32 -O2 abc.c
abc.c:14:1: internal compiler error: in estimate_node_size_and_time, at
ipa-inline-analysis.c:3425
 void fn3() { fn2(b); }
 ^~~~
0x98ef05 estimate_node_size_and_time
../../gcc/gcc/ipa-inline-analysis.c:3425
0x991513 do_estimate_edge_time(cgraph_edge*)
../../gcc/gcc/ipa-inline-analysis.c:3935
0x991a67 do_estimate_edge_size(cgraph_edge*)
../../gcc/gcc/ipa-inline-analysis.c:3989
0x991cbf estimate_edge_size
../../gcc/gcc/ipa-inline.h:304
0x991cbf estimate_edge_growth
../../gcc/gcc/ipa-inline.h:315
0x991cbf estimate_size_after_inlining(cgraph_node*, cgraph_edge*)
../../gcc/gcc/ipa-inline-analysis.c:4064
0x1315832 caller_growth_limits
../../gcc/gcc/ipa-inline.c:184
0x1315832 can_inline_edge_p
../../gcc/gcc/ipa-inline.c:382
0x131b622 inline_small_functions
../../gcc/gcc/ipa-inline.c:1822
0x131b622 ipa_inline
../../gcc/gcc/ipa-inline.c:2438
0x131b622 execute
../../gcc/gcc/ipa-inline.c:2849
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 abc.c
int a, g;
char b, e;
short c, d, f;
long long h;
void fn1() {
  for (;;)
;
}
void fn2(char p1) {
  b |= 5 > a < (f ?: e);
  fn1(a % c || (f -= 0) || 0, d < b,
  c < h % (h > d) ^ g ^ d ? 7 / (c /= b) : (h /= a %= a));
}
void fn3() { fn2(b); }

[Bug target/80540] gcc ICE at -O2 and above on x86_64-linux-gnu in "assign_by_spills"

2017-04-27 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80540

--- Comment #4 from Qirun Zhang  ---
(In reply to Martin Liška from comment #2)
> > gcc-4.8.5 crashes at all levels;
> > gcc-4.9 accepts it at all levels;
> 
> I can't find a release that does not ICE w/ -O2.

Hi Martin,

This version works fine.

$ gcc-4.9 -O2 abc.c -c
$ gcc-4.9 --version
gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug tree-optimization/80540] New: gcc ICE at -O2 and above on x86_64-linux-gnu in "assign_by_spills"

2017-04-26 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80540

Bug ID: 80540
   Summary: gcc ICE at -O2 and above on x86_64-linux-gnu in
"assign_by_spills"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O2 and above on x86_64-linux-gnu in both 32- and 64-bit modes. Unlike PR79636,
-O0 and -O1 work fine.

Moreover, 

gcc-4.8.5 crashes at all levels;
gcc-4.9 accepts it at all levels;
gcc-5.X,6 accept it at -O1 and -O0, and reject it at -O2 and above.


$ gcc-trunk --version
gcc-trunk (GCC) 8.0.0 20170426 (experimental) [trunk revision 247284]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



$ gcc-trunk -O2 abc.c
abc.c: In function ‘fn2’:
abc.c:15:1: error: unable to find a register to spill
 }
 ^
abc.c:15:1: error: this is the insn:
(insn 14 37 36 3 (parallel [
(set (reg:SI 101 [94])
(truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 102
[100]))
(sign_extend:DI (reg:SI 95)))
(const_int 32 [0x20]
(clobber (reg:SI 102 [100]))
(clobber (reg:CC 17 flags))
]) "abc.c":5 355 {*smulsi3_highpart_1}
 (expr_list:REG_UNUSED (reg:SI 102 [100])
(expr_list:REG_DEAD (reg:SI 95)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_EQUAL (truncate:SI (lshiftrt:DI (mult:DI
(sign_extend:DI (reg:SI 93 [ a ]))
(const_int 274877907 [0x10624dd3]))
(const_int 32 [0x20])))
(nil))
abc.c:15:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1476
0xb19c98 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.c:108
0xa07acb assign_by_spills
../../gcc/gcc/lra-assigns.c:1476
0xa08526 lra_assign()
../../gcc/gcc/lra-assigns.c:1670
0xa03ad4 lra(_IO_FILE*)
../../gcc/gcc/lra.c:2451
0x9b9dd1 do_reload
../../gcc/gcc/ira.c:5472
0x9b9dd1 execute
../../gcc/gcc/ira.c:5656
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 abc.c
int g, a;
void fn1() {
  int b = ({
register __typeof__(0) c asm("rdx");
g = a / 1000;
c;
  });
  if (b)
a = 0;
}
void fn2() {
  switch (g)
  case 0:
  fn1();
}

[Bug tree-optimization/80539] New: gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "chrec_fold_plus_poly_poly"

2017-04-26 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80539

Bug ID: 80539
   Summary: gcc ICE at -O2 and above on valid code on
x86_64-linux-gnu in "chrec_fold_plus_poly_poly"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O2 and above on x86_64-linux-gnu in both 32- and 64-bit modes. 


$ gcc-trunk --version
gcc-trunk (GCC) 8.0.0 20170426 (experimental) [trunk revision 247284]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



$ gcc-trunk -O2 abc.c
abc.c: In function ‘fn1’:
abc.c:2:6: internal compiler error: in chrec_fold_plus_poly_poly, at
tree-chrec.c:152
 void fn1() {
  ^~~
0x1373a17 chrec_fold_plus_poly_poly
../../gcc/gcc/tree-chrec.c:152
0x1373a17 chrec_fold_plus_1
../../gcc/gcc/tree-chrec.c:285
0xc744fb interpret_rhs_expr
../../gcc/gcc/tree-scalar-evolution.c:1839
0xc7117c interpret_gimple_assign
../../gcc/gcc/tree-scalar-evolution.c:2008
0xc7117c analyze_scalar_evolution_1
../../gcc/gcc/tree-scalar-evolution.c:2092
0xc71a5e analyze_scalar_evolution(loop*, tree_node*)
../../gcc/gcc/tree-scalar-evolution.c:2147
0xc74c4a interpret_rhs_expr
../../gcc/gcc/tree-scalar-evolution.c:1935
0xc7117c interpret_gimple_assign
../../gcc/gcc/tree-scalar-evolution.c:2008
0xc7117c analyze_scalar_evolution_1
../../gcc/gcc/tree-scalar-evolution.c:2092
0xc71a5e analyze_scalar_evolution(loop*, tree_node*)
../../gcc/gcc/tree-scalar-evolution.c:2147
0xcfc269 infer_loop_bounds_from_signedness
../../gcc/gcc/tree-ssa-loop-niter.c:3412
0xcfc269 infer_loop_bounds_from_undefined
../../gcc/gcc/tree-ssa-loop-niter.c:3469
0xcfc269 estimate_numbers_of_iterations_loop
../../gcc/gcc/tree-ssa-loop-niter.c:3852
0xcfce13 estimate_numbers_of_iterations()
../../gcc/gcc/tree-ssa-loop-niter.c:4065
0xcd4479 tree_unroll_loops_completely(bool, bool)
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1369
0xcd4b35 execute
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1586
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 abc.c
char a, b;
void fn1() {
  char c, e;
  short d;
  if (0) {
for (; d;) {
l1:
  for (c = 7; a; c++)
;
  e = 6;
  for (; b; e++)
;
}
c -= e;
  }
  if (d == 7)
goto l1;
  a = c;
}

[Bug rtl-optimization/80499] ICE on RTL code on x86_64-linux-gnu in "extract_insn"

2017-04-24 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80499

--- Comment #3 from Qirun Zhang  ---
(In reply to Richard Biener from comment #2)
> Do you have a C fragment producing this RTL?

Hi Richard,

The original RTL file is at testsuite/gcc.dg/rtl/x86_64/final.c. 
The original C file seems to be testsuite/gcc.dg/rtl/test.c with modifications.

[Bug rtl-optimization/80499] New: gcc ICE on RTL code on x86_64-linux-gnu in "extract_insn"

2017-04-23 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80499

Bug ID: 80499
   Summary: gcc ICE on RTL code on x86_64-linux-gnu in
"extract_insn"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid RTL fragment causes an ICE when compiled with the current
gcc trunk on x86_64-linux-gnu in 32-bit mode. The 64-bit mode works fine.

$ gcc-trunk --version
gcc-trunk (GCC) 8.0.0 20170423 (experimental) [trunk revision 247083]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ gcc-trunk -m32 abc1.c
abc1.c: In function ‘test_1’:
abc1.c:20:1: error: unrecognizable insn:
 }
 ^
(insn 2 6 7 2 (set (mem:DI (pre_dec (reg/f:SI 7 sp)) [0  S8 A8])
(reg/f:SI 6 bp)) -1
 (nil))
abc1.c:20:1: internal compiler error: in extract_insn, at recog.c:2311
0xb19d38 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.c:108
0xb19d69 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/gcc/rtl-error.c:116
0xae7a6f extract_insn(rtx_insn*)
../../gcc/gcc/recog.c:2311
0xae7ac1 extract_insn_cached(rtx_insn*)
../../gcc/gcc/recog.c:2201
0x86a3a7 cleanup_subreg_operands(rtx_insn*)
../../gcc/gcc/final.c:3152
0x86c551 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc/gcc/final.c:2948
0x86da21 final(rtx_insn*, _IO_FILE*, int)
../../gcc/gcc/final.c:2051
0x86df09 rest_of_handle_final
../../gcc/gcc/final.c:4489
0x86df09 execute
../../gcc/gcc/final.c:4562
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 abc1.c
int __RTL (startwith ("final")) test_1 ()
{
(function ""
 (insn-chain
  (block 2
   (edge-from entry )
   (cnote 6 [bb 2] NOTE_INSN_BASIC_BLOCK)
   (cinsn 2 (set (mem:DI (pre_dec(reg sp)) [0  ])
 (reg bp)) )
  ) (block 3
 (cinsn 3 (parallel [
   (set (reg ax  )
(plus(reg ax )
 (const_int 4)))
   ]) )
) (block 4
   (edge-from 2)
   (cnote 7 [bb 4] NOTE_INSN_BASIC_BLOCK)
  ) (cbarrier 0) ) )
}

[Bug tree-optimization/80497] New: gcc ICE at -O1 and above on valid code on x86_64-linux-gnu in "tree_to_uhwi"

2017-04-23 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80497

Bug ID: 80497
   Summary: gcc ICE at -O1 and above on valid code on
x86_64-linux-gnu in "tree_to_uhwi"
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O1 and above on x86_64-linux-gnu in 64-bit mode


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20170423 (experimental) [trunk revision 247083] (GCC)


$ gcc-trunk -O1 abc.c
abc.c: In function ‘fn1’:
abc.c:5:6: internal compiler error: in tree_to_uhwi, at tree.c:7346
 void fn1() {
  ^~~
0xe336c7 tree_to_uhwi(tree_node const*)
../../gcc/gcc/tree.c:7346
0x12af2ac get_int_range
../../gcc/gcc/gimple-ssa-sprintf.c:956
0x12b039d set_width
../../gcc/gcc/gimple-ssa-sprintf.c:676
0x12b039d parse_directive
../../gcc/gcc/gimple-ssa-sprintf.c:3146
0x12b039d compute_format_length
../../gcc/gcc/gimple-ssa-sprintf.c:3256
0x12b4655 handle_gimple_call
../../gcc/gcc/gimple-ssa-sprintf.c:3688
0x12b5427 execute
../../gcc/gcc/gimple-ssa-sprintf.c:3716
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 abc.c
extern char buf[];
#define T(fmt, ...) __builtin_sprintf(buf, fmt, __VA_ARGS__);
const __int128_t sint128_max = (__int128_t)1
   << sizeof sint128_max * __CHAR_BIT__ - 2;
void fn1() {
  __int128_t si128 = sint128_max;
  T("%*i", si128)
}

[Bug tree-optimization/78248] [7 Regression] wrong code at -Os and above on x86_64-linux-gnu (in both 32-bit and 64-bit modes)

2016-11-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78248

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #5 from Qirun Zhang  ---
My r241966 build also miscompiles.

[Bug tree-optimization/72746] New: gcc ICE at -O2 and above on valid code on x86_64-linux-gnu with “seg fault”

2016-07-28 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72746

Bug ID: 72746
   Summary: gcc ICE at -O2 and above on valid code on
x86_64-linux-gnu with “seg fault”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at  -O2 and -O3 on x86_64-linux-gnu in both 32- and 64-bit modes.


It appears to be a 7 regression.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160728 (experimental) [trunk revision 238824] (GCC) 

$ gcc-trunk -O2 abc.c
abc.c: In function ‘fn1’:
abc.c:12:20: warning: division by zero [-Wdiv-by-zero]
   *d = a *= (c %= 0) > c + (f ? c : e);
^~
abc.c:17:9: warning: division by zero [-Wdiv-by-zero]
   f %= 0;
 ^~
gcc-trunk: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ cat abc.c
int a, b, f;
long c;
int *d;
unsigned long e;
void fn1 ()
{
  for (; f;)
{
  for (;;)
;
lblE83BAD08:
  *d = a *= (c %= 0) > c + (f ? c : e);
}
  if ((a = 0) || (a = b ? 8 : a))
{
  f = 3;
  f %= 0;
  goto lblE83BAD08;
}
}

[Bug tree-optimization/71916] [6/7 Regression] ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start"

2016-07-19 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71916

--- Comment #9 from Qirun Zhang  ---
(In reply to Martin Liška from comment #7)
> Hm, the second test-case works fine with r233209, but started to fail with
> r236831:
> 
> Author: law 
> Date:   Fri May 27 16:32:38 2016 +
> 
> * tree-ssa-threadedge.c: Remove include of tree-ssa-threadbackward.h.
> (thread_across_edge): Remove calls to find_jump_threads_backwards.
> * passes.def: Add jump threading passes before DOM/VRP.
> * tree-ssa-threadbackward.c (find_jump_threads_backwards): Change
> argument to a basic block from an edge.  Remove tests which are
> handled elsewhere.
> (pass_data_thread_jumps, class pass_thread_jumps): New.
> (pass_thread_jumps::gate, pass_thread_jumps::execute): New.
> (make_pass_thread_jumps): Likewise.
> * tree-pass.h (make_pass_thread_jumps): Declare.
> 
> * gcc.dg/tree-ssa/pr21417.c: Update expected output.
> * gcc.dg/tree-ssa/pr66752-3.c: Likewise.
> * gcc.dg/tree-ssa/pr68198.c: Likewise.
> * gcc.dg/tree-ssa/pr69196-1.c: Likewise.
> * gcc.dg/tree-ssa/pr69270-3.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-2b.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-2g.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-2h.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-6.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-12.c: Likewise.
> * gcc.dg/tree-ssa/ssa-dom-thread-13.c: Likewise.
> * gcc.dg/tree-ssa/vrp56.c: Likewise.

Will it be a good idea to separate the two bugs (i.e., to create a new PR for
the second case)?

[Bug tree-optimization/71916] [6/7 Regression] ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start"

2016-07-19 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71916

--- Comment #5 from Qirun Zhang  ---
(In reply to Qirun Zhang from comment #4)
> (In reply to rguent...@suse.de from comment #3)
> > On Tue, 19 Jul 2016, marxin at gcc dot gnu.org wrote:
> > 
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71916
> > > 
> > > Martin Liška  changed:
> > > 
> > >What|Removed |Added
> > > 
> > >  CC||rguenth at gcc dot 
> > > gnu.org
> > > 
> > > --- Comment #2 from Martin Liška  ---
> > > Started with r233209:
> > > 
> > >2016-02-08   Richard Biener  
> > > 
> > > PR rtl-optimization/69274
> > > * ira.c (ira_setup_alts): Do not change recog_data.operand
> > > order.
> > > 
> > > * gcc.target/i386/addr-sel-1.c: XFAIL.
> > 
> > This patch is known to change register allocation thus it very likely
> > just uncovers a latent issue.
> 
> Hi Richard,
> 
> I have another testcase. This time, it crashes only in 32-bit mode while the
> 64-bit mode works just fine.
> 
> The ICE trace is exact the same as the original one. I am not sure if they
> are the same..
> 
> 
> The testcase is:
> 
> int a, b, d, f;
> volatile int c;
> volatile int e;
> long long(fn1)() {}
> char fn2(int *p1) {
>   if (fn1(f))
> e;
> }
> int *fn3() {}
> short fn4() { b = 0; }
> void fn5() {
>   b = 2;
>   a || fn2(fn3(fn4()));
>   char g[4];
>   int i;
>   for (; c; d++)
> ;
>   for (e; b < 4; i++)
> g[i] = 9;
>   for (; b;)
> ;
> }

$ gcc-trunk -O3 abc.c -c
$ gcc-trunk -O3 abc.c -c -m32
abc.c: In function ‘fn5’:
abc.c:22:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2284
 }
 ^
0x7e0d80 maybe_record_trace_start
../../gcc/gcc/dwarf2cfi.c:2284
0x7e1085 create_trace_edges
../../gcc/gcc/dwarf2cfi.c:2376
0x7e31d1 scan_trace
../../gcc/gcc/dwarf2cfi.c:2590
0x7e3cca create_cfi_notes
../../gcc/gcc/dwarf2cfi.c:2616
0x7e3cca execute_dwarf2_frame
../../gcc/gcc/dwarf2cfi.c:2974
0x7e3cca execute
../../gcc/gcc/dwarf2cfi.c:3454
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/71916] [6/7 Regression] ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start"

2016-07-19 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71916

--- Comment #4 from Qirun Zhang  ---
(In reply to rguent...@suse.de from comment #3)
> On Tue, 19 Jul 2016, marxin at gcc dot gnu.org wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71916
> > 
> > Martin Liška  changed:
> > 
> >What|Removed |Added
> > 
> >  CC||rguenth at gcc dot gnu.org
> > 
> > --- Comment #2 from Martin Liška  ---
> > Started with r233209:
> > 
> >2016-02-08   Richard Biener  
> > 
> > PR rtl-optimization/69274
> > * ira.c (ira_setup_alts): Do not change recog_data.operand
> > order.
> > 
> > * gcc.target/i386/addr-sel-1.c: XFAIL.
> 
> This patch is known to change register allocation thus it very likely
> just uncovers a latent issue.

Hi Richard,

I have another testcase. This time, it crashes only in 32-bit mode while the
64-bit mode works just fine.

The ICE trace is exact the same as the original one. I am not sure if they are
the same..


The testcase is:

int a, b, d, f;
volatile int c;
volatile int e;
long long(fn1)() {}
char fn2(int *p1) {
  if (fn1(f))
e;
}
int *fn3() {}
short fn4() { b = 0; }
void fn5() {
  b = 2;
  a || fn2(fn3(fn4()));
  char g[4];
  int i;
  for (; c; d++)
;
  for (e; b < 4; i++)
g[i] = 9;
  for (; b;)
;
}

[Bug tree-optimization/71916] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start"

2016-07-18 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71916

Bug ID: 71916
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
"maybe_record_trace_start"
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in 64-bit mode. The 32-bit mode works fine.

It appears to be a 7 regression.

It might be related to PR71109, but that testcase cannot crash the current
trunk any more.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160717 (experimental) [trunk revision 238419] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn2’:
abc.c:35:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2284
 }
 ^
0x7e0d80 maybe_record_trace_start
../../gcc/gcc/dwarf2cfi.c:2284
0x7e1085 create_trace_edges
../../gcc/gcc/dwarf2cfi.c:2376
0x7e31d1 scan_trace
../../gcc/gcc/dwarf2cfi.c:2590
0x7e3cca create_cfi_notes
../../gcc/gcc/dwarf2cfi.c:2616
0x7e3cca execute_dwarf2_frame
../../gcc/gcc/dwarf2cfi.c:2974
0x7e3cca execute
../../gcc/gcc/dwarf2cfi.c:3454
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
int a, b, c, d, f, g;
short h;
short (fn1) (short p1)
{
  return a >= 2 || p1 > 7 >> a ? p1 : p1 << a;
}

void fn2 ()
{
  for (;;)
{
  int j[3];
  int i;
  h = b >= 2 ? d : d >> b;
  if (fn1 (f > h ^ c))
{
  d = 0;
  for (; f <= 2;)
{
  char k[2];
  for (;; i++)
k[i] = 7;
}
}
  else
for (;;)
  {
int l = j[2];
g = l;
  }
  if (g)
for (;;)
  ;
}
}

[Bug tree-optimization/71830] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu: verify_gimple failed

2016-07-10 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71830

Bug ID: 71830
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu:
verify_gimple failed
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in only 32-bit mode.


It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160710 (experimental) [trunk revision 238196] (GCC)


$ gcc-trunk -O3 -c abc.c
$ gcc-trunk -O3 -m32 abc.c
abc.c: In function ‘fn1’:
abc.c:7:6: error: non-trivial conversion at assignment
 void fn1() {
  ^~~
int
struct S0
# VUSE <.MEM_5(D)>
pretmp_4 = b;
abc.c:7:6: internal compiler error: verify_gimple failed
0xbb5e35 verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5212
0xaa1cc3 execute_function_todo
../../gcc/gcc/passes.c:1964
0xaa2d0b execute_todo
../../gcc/gcc/passes.c:2016
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.c
#pragma pack(1)
struct S0 {
  int f0;
};
char a, d;
static struct S0 b, c;
void fn1() {
  for (;;) {
struct S0 e = b;
c = b;
d = e.f0;
for (; a;)
  b = c;
  }
}

[Bug debug/71667] [7 Regression] ICE in as_a, at is-a.h:192 w/ -g -O2 -ftree-vectorize

2016-07-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71667

--- Comment #8 from Qirun Zhang  ---
(In reply to alahay01 from comment #7)
> Fixed.
> 
> Additional issue found by Qirun has been raised as PR 71818

Hi Alan, Sorry that I missed your previous message..

[Bug tree-optimization/71802] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in expand_LOOP_VECTORIZED

2016-07-07 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71802

Bug ID: 71802
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
expand_LOOP_VECTORIZED
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in both 32- and 64-bit modes.


It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160707 (experimental) [trunk revision 238108] (GCC) 



$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:26:7: warning: assignment from incompatible pointer type
[-Wincompatible-pointer-types]
 i = &h;
   ^
abc.c:28:7: warning: assignment from incompatible pointer type
[-Wincompatible-pointer-types]
 i = &f;
   ^
abc.c:3:6: internal compiler error: in expand_LOOP_VECTORIZED, at
internal-fn.c:1944
 void fn1() {
  ^~~
0x969f07 expand_LOOP_VECTORIZED
../../gcc/gcc/internal-fn.c:1944
0x75a117 expand_call_stmt
../../gcc/gcc/cfgexpand.c:2573
0x75a117 expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.c:3574
0x75a117 expand_gimple_stmt
../../gcc/gcc/cfgexpand.c:3740
0x75d700 expand_gimple_basic_block
../../gcc/gcc/cfgexpand.c:5747
0x7624c6 execute
../../gcc/gcc/cfgexpand.c:6362
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
int b, c;
long d, f;
void fn1() {
  char g;
  long long h = 0;
  int *i;
  if (0) {
  L2:
b && (b = f);
d = 3;
for (; d;) {
  char *j = &g;
  c = *j = 0;
L3:
  *j %= b;
  for (; g <= 4;)
;
}
goto L2;
  }
  for (; *i; *i = 1) {
if ((h -= 4) == (h != (b ?: d))) {
  g = 3;
  goto L3;
}
i = &h;
*i = f;
i = &f;
if ((h && 6) - (h = 0))
  goto L2;
  }
  for (; d;)
goto L3;
}

[Bug debug/71667] [7 Regression] ICE in as_a, at is-a.h:192 w/ -g -O2 -ftree-vectorize

2016-07-01 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71667

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #4 from Qirun Zhang  ---
(In reply to alahay01 from comment #3)
> "-g" is the important thing here.
> 
> A statement has been marked live, and a use of it outside the loop is a
> DEBUG stmt.
> 
> vectorizable_live_operation fails trying to treat the DEBUG stmt as a phi.

Here is a case triggering the ICE without the "-g".

I am not sure if it is a dup, so I leave it here. My bisection indicates that
the ICE for this case also starts with r237064.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160701 (experimental) [trunk revision 237910] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:4:6: internal compiler error: in as_a, at is-a.h:192
 void fn1() {
  ^~~
0x5e1131 gphi const* as_a(gimple const*)
../../gcc/gcc/is-a.h:192
0x5e1131 gimple_phi_num_args
../../gcc/gcc/gimple.h:4264
0xdbd150 gimple_phi_result
../../gcc/gcc/ssa-iterators.h:921
0xdbd150 vectorizable_live_operation(gimple*, gimple_stmt_iterator*,
_slp_tree*, int, gimple**)
../../gcc/gcc/tree-vect-loop.c:6417
0xdb6a9f vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
../../gcc/gcc/tree-vect-stmts.c:8439
0xdbd905 vect_transform_loop(_loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:6893
0xdda9fe vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:558
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
char a;
short b;
int c, d;
void fn1() {
  char e = 75, g;
  unsigned char *f = &e;
  a = 21;
  for (; a <= 48; a++) {
for (; e <= 6;)
  ;
g -= e -= b || g <= c;
  }
  d = *f;
}

[Bug tree-optimization/71503] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in "gen_phi_arg_condition"

2016-06-11 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71503

Bug ID: 71503
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
"gen_phi_arg_condition"
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in both 32- and 64-bit modes. 

It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160611 (experimental) [trunk revision 237328] (GCC)



$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:3:6: internal compiler error: in gen_phi_arg_condition, at
tree-if-conv.c:1705
 void fn1() {
  ^~~
0xbd09a9 gen_phi_arg_condition
../../gcc/gcc/tree-if-conv.c:1705
0xbd09a9 predicate_scalar_phi
../../gcc/gcc/tree-if-conv.c:1901
0xbd0db0 predicate_all_scalar_phis
../../gcc/gcc/tree-if-conv.c:1946
0xbd0db0 combine_blocks
../../gcc/gcc/tree-if-conv.c:2301
0xbd49d6 tree_if_conversion
../../gcc/gcc/tree-if-conv.c:2663
0xbd49d6 execute
../../gcc/gcc/tree-if-conv.c:2749
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
int a, b;
unsigned long d;
void fn1() {
  unsigned long *h = &d;
line1 : {
  int i = 4;
  for (; b; i++) {
d = ((d + 6 ?: *h) ? a : 7) && (i &= 0 >= b);
b += a;
  }
}
  h = 0;
  for (; *h;)
goto line1;
}

[Bug tree-optimization/71416] [7 Regression] ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (vectorizable_live_operation)

2016-06-10 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71416

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #6 from Qirun Zhang  ---
(In reply to alahay01 from comment #3)
> Looking at the ICE, this looks like a duplicate of
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71407
> 
> Tested in my current work-in-progress for 71407 and the ICE looks fixed.
> 
> Will roll this testcase into the fix for 71407.

Hello,

It seems that this testcase still triggers an ICE even after r237288.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160610 (experimental) [trunk revision 237307] (GCC)


$ gcc-trunk -O3 a.c
a.c: In function ‘main’:
a.c:5:5: internal compiler error: in vectorizable_live_operation, at
tree-vect-loop.c:6354
 int main() {
 ^~~~
0xdaba79 vectorizable_live_operation(gimple*, gimple_stmt_iterator*,
_slp_tree*, int, gimple**)
../../gcc/gcc/tree-vect-loop.c:6354
0xda8238 vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
../../gcc/gcc/tree-vect-stmts.c:8334
0xdaeddc vect_transform_loop(_loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:6888
0xdcbe55 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



a.c is the testcase in this pr.

[Bug tree-optimization/71485] New: g++ ICE on x86_64-linux-gnu in “gimplify_expr”

2016-06-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71485

Bug ID: 71485
   Summary: g++ ICE on x86_64-linux-gnu in “gimplify_expr”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current g++
trunk on x86_64-linux-gnu in 32-bit mode. 

It is a 7 regression.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160608 (experimental) [trunk revision 237212] (GCC) 


$ g++-trunk -m32 abc.cc
abc.cc:1:33: error: overflow in enumeration values at ‘e3’
 enum { e1 = 0x, e3 } e = e3;
 ^~
abc.cc: In function ‘void __static_initialization_and_destruction_0(int, int)’:
abc.cc:1:38: internal compiler error: in gimplify_expr, at gimplify.c:11097
 enum { e1 = 0x, e3 } e = e3;
  ^
0xaeaa5f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11097
0xafb5da gimplify_modify_expr
../../gcc/gcc/gimplify.c:4762
0xae893a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10349
0xaec9f8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5731
0xae81fa gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:5507
0xae81fa gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10714
0xaec9f8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5731
0xae7b63 gimplify_statement_list
../../gcc/gcc/gimplify.c:1549
0xae7b63 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10766
0xaec9f8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5731
0xaf0c3d gimplify_cond_expr
../../gcc/gcc/gimplify.c:3286
0xae86d0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10305
0xaec9f8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5731
0xaf0c3d gimplify_cond_expr
../../gcc/gcc/gimplify.c:3286
0xae86d0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10305
0xaec9f8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5731
0xafcd84 gimplify_body(tree_node*, bool)
../../gcc/gcc/gimplify.c:11532
0xafd3c6 gimplify_function_tree(tree_node*)
../../gcc/gcc/gimplify.c:11688
0x969bf7 cgraph_node::analyze()
../../gcc/gcc/cgraphunit.c:625
0x96ceff analyze_functions
../../gcc/gcc/cgraphunit.c:1086
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat abc.cc
enum { e1 = 0x, e3 } e = e3;

[Bug tree-optimization/71483] New: g++ ICE at -O3 on valid code on x86_64-linux-gnu with “Floating point exception”

2016-06-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71483

Bug ID: 71483
   Summary: g++ ICE at -O3 on valid code on x86_64-linux-gnu with
“Floating point exception”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current g++ trunk
at only -O3 on x86_64-linux-gnu in 32- and 64-bit modes. 

gcc at -O3 works fine.

It started with r237064. I am not sure if it is a dup of pr71416 or pr71407.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160608 (experimental) [trunk revision 237212] (GCC) 


$ gcc-trunk -O3 -c abc.c
$
$ g++-trunk -O3 -c abc.c
abc.c: In function ‘void fn1()’:
abc.c:3:6: internal compiler error: Floating point exception
 void fn1() {
  ^~~
0xd3d9cf crash_signal
../../gcc/gcc/toplev.c:335
0xf833cc vectorizable_live_operation(gimple*, gimple_stmt_iterator*,
_slp_tree*, int, gimple**)
../../gcc/gcc/tree-vect-loop.c:6377
0xf7fdb6 vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
../../gcc/gcc/tree-vect-stmts.c:8327
0xf9da2b vect_schedule_slp_instance
../../gcc/gcc/tree-vect-slp.c:3641
0xf9d7f4 vect_schedule_slp_instance
../../gcc/gcc/tree-vect-slp.c:3519
0xf9d7f4 vect_schedule_slp_instance
../../gcc/gcc/tree-vect-slp.c:3519
0xf9e2a6 vect_schedule_slp(vec_info*)
../../gcc/gcc/tree-vect-slp.c:3713
0xf8729d vect_transform_loop(_loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:6865
0xfa3c85 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.c
int b, c, d;
short *e;
void fn1() {
  for (; b; b--) {
d = *e >> 2;
*e++ = d;
c = *e;
*e++ = d;
  }
}

[Bug tree-optimization/71407] [7 Regression] ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (verify_gimple: integral result type precision does not match field size of BIT_FIELD_REF)

2016-06-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71407

--- Comment #6 from Qirun Zhang  ---
(In reply to alahay01 from comment #5)
> Qirun Zhang :
> 
> That's a different issue (original test fails due to data type mismatch,
> this test fails because the loop boundary is unset).
> 
> Please could you raise your test as a new bug and assign it to me (I think I
> have a fix for it).

Thanks. I have opened as PR71477.

[Bug tree-optimization/71477] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu with “seg fault”

2016-06-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71477

Bug ID: 71477
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu with
“seg fault”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in 64-bit mode. 32-bit mode works fine.

It appears to be a 7 regression.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160608 (experimental) [trunk revision 237212] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:3:6: internal compiler error: Segmentation fault
 void fn1() {
  ^~~
0xb635cf crash_signal
../../gcc/gcc/toplev.c:335
0xe5a184 top_bit_of
../../gcc/gcc/wide-int.cc:424
0xe5a184 wi::add_large(long*, long const*, unsigned int, long const*, unsigned
int, unsigned int, signop, bool*)
../../gcc/gcc/wide-int.cc:1143
0xdad921 wi::binary_traits >, int,
wi::int_traits >
>::precision_type, wi::int_traits::precision_type>::result_type
wi::add >,
int>(generic_wide_int > const&, int const&)
../../gcc/gcc/wide-int.h:2330
0xdad921 wi::binary_traits >, int,
(wi::precision_type)2, wi::int_traits::precision_type>::result_type
generic_wide_int >::operator+(int const&)
const
../../gcc/gcc/wide-int.h:711
0xdad921 vect_transform_loop(_loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:6935
0xdc9bc5 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
#define N 6
int a;
void fn1() {
  int k = 0;
  for (; k < N;)
for (a = 0; a < N; k++)
  a = k + N;
}

[Bug tree-optimization/71407] [7 Regression] ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (verify_gimple: integral result type precision does not match field size of BIT_FIELD_REF)

2016-06-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71407

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #4 from Qirun Zhang  ---
A possible dup of this bug, with different crash info.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160608 (experimental) [trunk revision 237212] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:3:6: internal compiler error: Segmentation fault
 void fn1() {
  ^~~
0xb635cf crash_signal
../../gcc/gcc/toplev.c:335
0xe5a184 top_bit_of
../../gcc/gcc/wide-int.cc:424
0xe5a184 wi::add_large(long*, long const*, unsigned int, long const*, unsigned
int, unsigned int, signop, bool*)
../../gcc/gcc/wide-int.cc:1143
0xdad921 wi::binary_traits >, int,
wi::int_traits >
>::precision_type, wi::int_traits::precision_type>::result_type
wi::add >,
int>(generic_wide_int > const&, int const&)
../../gcc/gcc/wide-int.h:2330
0xdad921 wi::binary_traits >, int,
(wi::precision_type)2, wi::int_traits::precision_type>::result_type
generic_wide_int >::operator+(int const&)
const
../../gcc/gcc/wide-int.h:711
0xdad921 vect_transform_loop(_loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:6935
0xdc9bc5 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
#define N 6
int a;
void fn1() {
  int k = 0;
  for (; k < N;)
for (a = 0; a < N; k++)
  a = k + N;
}

[Bug tree-optimization/71462] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu with “seg fault”

2016-06-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71462

Bug ID: 71462
   Summary: gcc ICE at -O3  on valid code on x86_64-linux-gnu with
“seg fault”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160608 (experimental) [trunk revision 237212] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:3:6: internal compiler error: Segmentation fault
 void fn1() {
  ^~~
0xb635cf crash_signal
../../gcc/gcc/toplev.c:335
0xcbe6bb ei_container
../../gcc/gcc/basic-block.h:393
0xcbe6bb ei_end_p
../../gcc/gcc/basic-block.h:429
0xcbe6bb ei_cond
../../gcc/gcc/basic-block.h:479
0xcbe6bb find_uses_to_rename_bb
../../gcc/gcc/tree-ssa-loop-manip.c:442
0xcc0a5e find_uses_to_rename
../../gcc/gcc/tree-ssa-loop-manip.c:476
0xcc0a5e rewrite_into_loop_closed_ssa_1(bitmap_head*, unsigned int, int, loop*)
../../gcc/gcc/tree-ssa-loop-manip.c:642
0xca5b30 tree_unroll_loops_completely(bool, bool)
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1388
0xca6030 execute
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1531
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
short a;
long b;
void fn1() {
  int c = a = 1;
  for (; a; a++) {
for (; 9 <= 8;)
  for (;;) {
a = 20;
for (; a <= 35; a++)
  ;
  line:;
  }
if ((c += 264487869) == 9) {
  unsigned *d = 0;
  for (; b;)
d = (unsigned *)&c;
  if (d)
for (;;)
  ;
}
  }
  goto line;
}

[Bug c/71426] New: gcc ICE on x86_64-linux-gnu in get_parm_info, at c/c-decl.c:7059

2016-06-05 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71426

Bug ID: 71426
   Summary: gcc ICE on x86_64-linux-gnu in get_parm_info, at
c/c-decl.c:7059
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It affects the current trunk, 4.X. But works for 5.X and 6.X.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160605 (experimental) [trunk revision 237097] (GCC)


$ gcc-trunk a.c
a.c:1:33: error: ‘ID1’ undeclared here (not in a function)
 signed * * ID0 ( inline ID1 [ + ID1 %  3.14 - ID1 ( ) ] ) ;
 ^~~
a.c:1:47: warning: implicit declaration of function ‘ID1’
[-Wimplicit-function-declaration]
 signed * * ID0 ( inline ID1 [ + ID1 %  3.14 - ID1 ( ) ] ) ;
   ^~~
a.c:1:25: warning: type defaults to ‘int’ in declaration of ‘ID1’
[-Wimplicit-int]
 signed * * ID0 ( inline ID1 [ + ID1 %  3.14 - ID1 ( ) ] ) ;
 ^~~
a.c:1:25: warning: parameter ‘ID1’ declared ‘inline’
a.c:1:1: internal compiler error: in get_parm_info, at c/c-decl.c:7059
 signed * * ID0 ( inline ID1 [ + ID1 %  3.14 - ID1 ( ) ] ) ;
 ^~
0x65d2dd get_parm_info(bool, tree_node*)
../../gcc/gcc/c/c-decl.c:7059
0x6c2160 c_parser_parms_list_declarator
../../gcc/gcc/c/c-parser.c:3756
0x6c22a0 c_parser_parms_declarator
../../gcc/gcc/c/c-parser.c:3672
0x6c4df9 c_parser_direct_declarator_inner
../../gcc/gcc/c/c-parser.c:3601
0x6c25d1 c_parser_declarator
../../gcc/gcc/c/c-parser.c:3362
0x6c25d1 c_parser_declarator
../../gcc/gcc/c/c-parser.c:3362
0x6c801a c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:1816
0x6d461d c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1549
0x6d5049 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1430
0x6d5049 c_parse_file()
../../gcc/gcc/c/c-parser.c:17930
0x737922 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat a.c
signed * * ID0 ( inline ID1 [ + ID1 %  3.14 - ID1 ( ) ] ) ;

[Bug c/71418] New: gcc ICE on x86_64-linux-gnu in min_align_of_type, at stor-layout.c:2402

2016-06-05 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71418

Bug ID: 71418
   Summary: gcc ICE on x86_64-linux-gnu in min_align_of_type, at
stor-layout.c:2402
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160604 (experimental) [trunk revision 237092] (GCC)


$ gcc-trunk abc.c
abc.c:1:25: error: lvalue required as increment operand
 _Alignas (char)   ID0 [ ++ 7 ] ;
 ^~
abc.c:1:1: warning: data definition has no type or storage class
 _Alignas (char)   ID0 [ ++ 7 ] ;
 ^~~~
abc.c:1:19: warning: type defaults to ‘int’ in declaration of ‘ID0’
[-Wimplicit-int]
 _Alignas (char)   ID0 [ ++ 7 ] ;
   ^~~
abc.c:1:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in min_align_of_type, at stor-layout.c:2402
 _Alignas (char)   ID0 [ ++ 7 ] ;
 ^~~~
0xe60277 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-source-trunk/gcc/tree.c:9802
0xbaf9dd tree_class_check
../../gcc-source-trunk/gcc/tree.h:3153
0xbaf9dd min_align_of_type(tree_node*)
../../gcc-source-trunk/gcc/stor-layout.c:2402
0x656259 grokdeclarator
../../gcc-source-trunk/gcc/c/c-decl.c:6319
0x65783a start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
../../gcc-source-trunk/gcc/c/c-decl.c:4442
0x6bc0c5 c_parser_declaration_or_fndef
../../gcc-source-trunk/gcc/c/c-parser.c:1963
0x6c6065 c_parser_external_declaration
../../gcc-source-trunk/gcc/c/c-parser.c:1549
0x6c68f9 c_parser_translation_unit
../../gcc-source-trunk/gcc/c/c-parser.c:1430
0x6c68f9 c_parse_file()
../../gcc-source-trunk/gcc/c/c-parser.c:17930
0x728e82 c_common_parse_file()
../../gcc-source-trunk/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
_Alignas (char)   ID0 [ ++ 7 ] ;

[Bug c/71266] New: gcc ICE on x86_64-linux-gnu in "store_parm_decls_oldstyle"

2016-05-24 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71266

Bug ID: 71266
   Summary: gcc ICE on x86_64-linux-gnu in
"store_parm_decls_oldstyle"
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It appears to be a 7 regression.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160524 (experimental) [trunk revision 236651] (GCC) 

$ gcc-trunk abc.c
abc.c:1:8: warning: return type defaults to ‘int’ [-Wimplicit-int]
 extern fn1 ( a ) enum b { a } ; { }
^~~
abc.c: In function ‘fn1’:
abc.c:1:18: warning: empty declaration
 extern fn1 ( a ) enum b { a } ; { }
  ^~~~
abc.c:1:27: error: ‘a’ declared as a non-parameter
 extern fn1 ( a ) enum b { a } ; { }
   ^
abc.c:1:27: internal compiler error: tree check: expected parm_decl, have
const_decl in store_parm_decls_oldstyle, at c/c-decl.c:8826
0xe2fc0c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9753
0x672678 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3030
0x672678 store_parm_decls_oldstyle
../../gcc/gcc/c/c-decl.c:8826
0x672678 store_parm_decls()
../../gcc/gcc/c/c-decl.c:8905
0x6c7e27 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:2095
0x6d37bd c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1549
0x6d41e9 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1430
0x6d41e9 c_parse_file()
../../gcc/gcc/c/c-parser.c:17914
0x736a12 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
extern fn1 ( a ) enum b { a } ; { }

[Bug c/71265] New: gcc ICE on x86_64-linux-gnu with “seg fault”

2016-05-24 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71265

Bug ID: 71265
   Summary: gcc ICE on x86_64-linux-gnu with “seg fault”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

This piece of code is syntactically valid since it can be parsed by an ANSI C
parser.

It crashes every release of gcc since gcc-3.4 (I did not have earlier versions
installed on my machine).



$ gcc-3.4 abc.c
abc.c: In function `ID':
abc.c:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see .



$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160524 (experimental) [trunk revision 236651] (GCC) 



$ gcc-trunk abc.c
abc.c:1:8: warning: return type defaults to ‘int’ [-Wimplicit-int]
 extern ID ( ID ) extern ID [ __func__ ] ; { }
^~
In function ‘ID’:
cc1: internal compiler error: Segmentation fault
0xbac48f crash_signal
../../gcc/gcc/toplev.c:333
0x652fb3 bind
../../gcc/gcc/c/c-decl.c:718
0x666ce8 c_make_fname_decl
../../gcc/gcc/c/c-decl.c:3996
0x6e89a1 fname_decl(unsigned int, unsigned int, tree_node*)
../../gcc/gcc/c-family/c-common.c:1006
0x6ab2cb c_parser_postfix_expression
../../gcc/gcc/c/c-parser.c:7627
0x6ad68a c_parser_unary_expression
../../gcc/gcc/c/c-parser.c:6939
0x6ae487 c_parser_cast_expression
../../gcc/gcc/c/c-parser.c:6768
0x6ae6a2 c_parser_binary_expression
../../gcc/gcc/c/c-parser.c:6577
0x6af385 c_parser_conditional_expression
../../gcc/gcc/c/c-parser.c:6348
0x6afa20 c_parser_expr_no_commas
../../gcc/gcc/c/c-parser.c:6265
0x6c404e c_parser_direct_declarator_inner
../../gcc/gcc/c/c-parser.c:3567
0x6c7370 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:1816
0x6c7f78 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:2094
0x6d37bd c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1549
0x6d41e9 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1430
0x6d41e9 c_parse_file()
../../gcc/gcc/c/c-parser.c:17914
0x736a12 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
extern ID ( ID ) extern ID [ __func__ ] ; { }

[Bug tree-optimization/71132] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu with “seg fault”

2016-05-15 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71132

Bug ID: 71132
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu with
“seg fault”
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It appears to be a 7 regression.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160515 (experimental) [trunk revision 236250] (GCC) 



$ gcc-trunk -O3 abc.c
abc.c: In function ‘main’:
abc.c:6:5: internal compiler error: Segmentation fault
 int main() {
 ^~~~
0xbaa52f crash_signal
../../gcc/gcc/toplev.c:333
0xbe18e0 bb_seq_addr
../../gcc/gcc/gimple.h:1654
0xbe18e0 gsi_last_bb
../../gcc/gcc/gimple-iterator.h:163
0xbe18e0 last_stmt(basic_block_def*)
../../gcc/gcc/tree-cfg.c:2640
0xc38900 create_edge_for_control_dependence
../../gcc/gcc/tree-loop-distribution.c:282
0xc39bb6 create_rdg_cd_edges
../../gcc/gcc/tree-loop-distribution.c:327
0xc39bb6 build_rdg
../../gcc/gcc/tree-loop-distribution.c:458
0xc39f0b distribute_loop
../../gcc/gcc/tree-loop-distribution.c:1418
0xc3cdc7 execute
../../gcc/gcc/tree-loop-distribution.c:1791
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ cat abc.c
typedef unsigned size_t;
struct {
  unsigned char buf[sizeof(long)];
} a;
size_t b;
int main() {
  size_t c, i;
  unsigned char *d;
  for (; c < sizeof(long);) {
d = a.buf;
b = 0;
for (; b < i; b++)
  *d++ = '\0';
for (; c < b; c++)
  *d++ = 'a';
c = 0;
for (; i < sizeof(long); i++)
  ;
  }
}

[Bug tree-optimization/71109] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start"

2016-05-13 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71109

Bug ID: 71109
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
"maybe_record_trace_start"
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in 64-bit mode. 32-bit mode works fine.

It appears to be a 7 regression.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160513 (experimental) [trunk revision 236209] (GCC)


$ gcc-trunk -O3 abc.c -c
abc.c: In function ‘fn2’:
abc.c:26:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2284
 }
 ^
0x827738 maybe_record_trace_start
../../gcc/gcc/dwarf2cfi.c:2284
0x829e30 scan_trace
../../gcc/gcc/dwarf2cfi.c:2462
0x82a66a create_cfi_notes
../../gcc/gcc/dwarf2cfi.c:2616
0x82a66a execute_dwarf2_frame
../../gcc/gcc/dwarf2cfi.c:2974
0x82a66a execute
../../gcc/gcc/dwarf2cfi.c:3454
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat abc.c
struct S0 {
  int f0;
  int f1;
  char f2;
  int f3;
  char f4;
  int f5;
  int f6;
  int f7;
  char f8;
} a, c;
struct S1 {
  char f0;
} e;
int *b;
int d;
void fn1();
void fn2() {
  for (; d;) {
fn1(fn2, a);
struct S1 f[3];
int k;
for (;; k++)
  f[k] = e;
  }
}
void fn1(int p1, struct S0 p2, struct S1 p3) {
  p3.f0 = 2;
  for (; p3.f0; p3.f0--) {
struct S0 *g = &a, *h = &c;
*h = *g = p2;
*b |= 6;
if (p2.f0)
  break;
  }
}

[Bug tree-optimization/71059] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in "vn_nary_op_insert_into"

2016-05-10 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71059

Bug ID: 71059
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
"vn_nary_op_insert_into"
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It appears to be a 7 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160510 (experimental) [trunk revision 236075] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn2’:
abc.c:8:6: internal compiler error: in vn_nary_op_insert_into, at
tree-ssa-sccvn.c:2735
 void fn2() {
  ^~~
0xd564b0 vn_nary_op_insert_into
../../gcc/gcc/tree-ssa-sccvn.c:2735
0xd569e6 vn_nary_build_or_lookup
../../gcc/gcc/tree-ssa-sccvn.c:1699
0xd5942c vn_reference_lookup_3
../../gcc/gcc/tree-ssa-sccvn.c:1955
0xca6e46 walk_non_aliased_vuses(ao_ref*, tree_node*, void* (*)(ao_ref*,
tree_node*, unsigned int, void*), void* (*)(ao_ref*, tree_node*, void*, bool*),
tree_node* (*)(tree_node*), void*)
../../gcc/gcc/tree-ssa-alias.c:2734
0xd575e0 vn_reference_lookup_pieces(tree_node*, int, tree_node*,
vec, vn_reference_s**, vn_lookup_kind)
../../gcc/gcc/tree-ssa-sccvn.c:2305
0xd37696 phi_translate_1
../../gcc/gcc/tree-ssa-pre.c:1599
0xd3551d phi_translate
../../gcc/gcc/tree-ssa-pre.c:1740
0xd383e4 do_partial_partial_insertion
../../gcc/gcc/tree-ssa-pre.c:3338
0xd383e4 insert_aux
../../gcc/gcc/tree-ssa-pre.c:3458
0xd37d1f insert_aux
../../gcc/gcc/tree-ssa-pre.c:3466
0xd37d1f insert_aux
../../gcc/gcc/tree-ssa-pre.c:3466
0xd3a3e7 insert
../../gcc/gcc/tree-ssa-pre.c:3489
0xd3a3e7 execute
../../gcc/gcc/tree-ssa-pre.c:4788
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.c
short a, c;
union {
  unsigned f0;
  unsigned short f1;
} b;
volatile int d;
short fn1(short p1) { return p1 + a; }
void fn2() {
  b.f0 = 0;
  for (;; b.f0 = fn1(b.f0))
(c && b.f1) || d;
}

[Bug tree-optimization/70916] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in "tree_operand_check"

2016-05-02 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70916

Bug ID: 70916
   Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
"tree_operand_check"
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It appears to be a 6 regression. Gcc-6.1 got an ICE at -O3 with seg fault.





$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160502 (experimental) [trunk revision 235753] (GCC)


$ gcc-trunk -O3 abc.c -c
abc.c: In function ‘fn1’:
abc.c:9:13: warning: initialization makes integer from pointer without a cast
[-Wint-conversion]
 int m = l;
 ^
abc.c:14:24: warning: comparison of distinct pointer types lacks a cast
   *e = (((*o = &g) != g) < h[c], 0) || k;
^~
abc.c:17:12: warning: assignment makes integer from pointer without a cast
[-Wint-conversion]
 *e = h;
^
abc.c:6:6: internal compiler error: tree check: expected class ‘expression’,
have ‘constant’ (integer_cst) in tree_operand_check, at tree.h:3523
 void fn1() {
  ^~~
0xe435a7 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9793
0x12f1f9d expr_check(tree_node*, char const*, int, char const*)
../../gcc/gcc/tree.h:3194
0x12f1f9d tree_operand_check(tree_node*, int, char const*, int, char const*)
../../gcc/gcc/tree.h:3523
0x12f1f9d vect_recog_mask_conversion_pattern
../../gcc/gcc/tree-vect-patterns.c:3677
0x12ec3c0 vect_pattern_recog_1
../../gcc/gcc/tree-vect-patterns.c:3851
0x12f13bd vect_pattern_recog(vec_info*)
../../gcc/gcc/tree-vect-patterns.c:4048
0xe07c77 vect_analyze_loop_2
../../gcc/gcc/tree-vect-loop.c:1847
0xe07c77 vect_analyze_loop(loop*)
../../gcc/gcc/tree-vect-loop.c:2264
0xe1e982 vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:532
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.c
int a, b, c, d, i, k;
int static *e = &b, *j;
int **f;
int static ***g = &f;
int *h;
void fn1() {
  for (;;) {
int l[1] = {};
int m = l;
for (; d; d--) {
  int n;
  int *o = &n;
  i = a & 7 ?: a;
  *e = (((*o = &g) != g) < h[c], 0) || k;
  if (*e) {
**n = &j;
*e = h;
  }
}
  }
}

[Bug tree-optimization/70442] New: gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "extract_insn"

2016-03-29 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70442

Bug ID: 70442
   Summary: gcc ICE at -O2 and above on valid code on
x86_64-linux-gnu in "extract_insn"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O2 and above on x86_64-linux-gnu in both 32-bit mode only.

It should be a 6 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160329 (experimental) [trunk revision 234517] (GCC) 


$ gcc-trunk -m32 -O2 abc.c
abc.c: In function ‘fn1’:
abc.c:11:1: error: unrecognizable insn:
 }
 ^
(insn 17 16 27 2 (set (subreg:V2DI (reg/v:DI 92 [ b ]) 0)
(reg/v:DI 87 [ b ])) abc.c:9 -1
 (expr_list:REG_DEAD (reg/v:DI 87 [ b ])
(nil)))
abc.c:11:1: internal compiler error: in extract_insn, at recog.c:2287
0xaf5528 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.c:108
0xaf5559 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/gcc/rtl-error.c:116
0xac2721 extract_insn(rtx_insn*)
../../gcc/gcc/recog.c:2287
0x1276dbe decompose_multiword_subregs
../../gcc/gcc/lower-subreg.c:1465
0x127803d execute
../../gcc/gcc/lower-subreg.c:1735
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat abc.c
char a, c;
void fn1() {
  long long b;
  long m;
  int d;
  switch (d)
  case 5:
  b = a;
  b ^= m;
  c = b >> b;
}

[Bug rtl-optimization/70023] [4.9/5/6 Regression] ICE: in assign_by_spills, at lra-assigns.c:1417 with -fschedule-insns

2016-03-23 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70023

--- Comment #7 from Qirun Zhang  ---
(In reply to Uroš Bizjak from comment #6)
> *** Bug 69773 has been marked as a duplicate of this bug. ***

PR69773 was reported and confirmed more than one month ago. The two bugs share
the same stack trace. IMHO, it should not be a duplicate.

[Bug tree-optimization/70160] [6 Regression] gcc ICE at -O2 (seg fault) and above on valid code on x86_64-linux-gnu

2016-03-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70160

--- Comment #2 from Qirun Zhang  ---
(In reply to Jakub Jelinek from comment #1)
> -msse2 is needed too.  Started with r228231.  Can't get rid of the
> uninitialized uses though:
> 
> long long a;
> void foo (void);
> void
> bar (unsigned t, int u, int v, unsigned p)
> {
>   long long x;
>   int i, j = 1;
>   for (t = i; j; )
> {
>   a = x;
>   x = 1 + t;
>   j += u;
>   foo ();
>   if (x == 1)
> return;
> }
> }

In my original test case (not the test case in c#0), the ICE will disappear if
variable i is initialized.

[Bug tree-optimization/70160] New: gcc ICE at -O2 (seg fault) and above on valid code on x86_64-linux-gnu

2016-03-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70160

Bug ID: 70160
   Summary: gcc ICE at -O2 (seg fault) and above on valid code on
x86_64-linux-gnu
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O2 and above on x86_64-linux-gnu in 32-bit mode.

The 64-bit mode works fine. It should be a 6 regression.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160309 (experimental) [trunk revision 234083] (GCC)




$ gcc-trunk -c -O2 abc.c
$ gcc-trunk -c -O2 abc.c -m32
abc.c: In function 'fn2':
abc.c:19:1: internal compiler error: Segmentation fault
 }
 ^
0xb5a51f crash_signal
../../gcc/gcc/toplev.c:335
0xaf9d0b volatile_refs_p(rtx_def const*)
../../gcc/gcc/rtlanal.c:2555
0xaf9df1 volatile_refs_p(rtx_def const*)
../../gcc/gcc/rtlanal.c:2594
0x11d3c93 deletable_insn_p_1
../../gcc/gcc/dce.c:84
0x11d4e90 prescan_insns_for_dce
../../gcc/gcc/dce.c:639
0x11d5449 fast_dce
../../gcc/gcc/dce.c:1052
0x11d60e4 rest_of_handle_fast_dce
../../gcc/gcc/dce.c:1147
0x11d61f8 run_fast_df_dce()
../../gcc/gcc/dce.c:1195
0x7b57d8 df_lr_finalize
../../gcc/gcc/df-problems.c:1018
0x7ae2bd df_analyze_problem(dataflow*, bitmap_head*, int*, int)
../../gcc/gcc/df-core.c:1183
0x7ae378 df_analyze_1
../../gcc/gcc/df-core.c:1234
0x122c1da if_convert
../../gcc/gcc/ifcvt.c:5308
0x122de4d execute
../../gcc/gcc/ifcvt.c:5513
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.c
long long a;
void fn1();
void fn2(t, a_int, x0, p) unsigned t;
int a_int;
int x0;
unsigned p;
{
  long long x;
  int i, j = 1;
  t = i;
  for (; j;) {
a = x;
x = 1 + t;
j += a_int;
fn1();
if (x == 1)
  return;
  }
}

[Bug tree-optimization/70152] New: gcc ICE at -O3 and above on valid code on x86_64-linux-gnu in "replace_uses_by"

2016-03-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70152

Bug ID: 70152
   Summary: gcc ICE at -O3 and above on valid code on
x86_64-linux-gnu in "replace_uses_by"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O3 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It should be a 6 regression.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160308 (experimental) [trunk revision 234065] (GCC)



$ gcc-trunk -O3 abc.c
abc.c: In function 'zfgetline.isra.0':
abc.c:17:1: internal compiler error: in replace_uses_by, at tree-cfg.c:1825
 }
 ^
0xb96859 replace_uses_by(tree_node*, tree_node*)
../../gcc/gcc/tree-cfg.c:1825
0xc3a82e replace_removed_params_ssa_names
../../gcc/gcc/tree-sra.c:4771
0xc3cdce ipa_sra_modify_function_body(vec)
../../gcc/gcc/tree-sra.c:4854
0xc3d5d1 modify_function
../../gcc/gcc/tree-sra.c:5173
0xc477b6 ipa_early_sra
../../gcc/gcc/tree-sra.c:5403
0xc477b6 execute
../../gcc/gcc/tree-sra.c:5450
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
int a;
int fgetc ();
void _setjmp ();
static int zfgetline (int p1)
{
  p1 = 0;
  _setjmp ();
  for (;;)
switch (p1)
  case 5:
  p1 = fgetc ();
}

void zftp_login ()
{
  zfgetline (a);
}

[Bug tree-optimization/70144] New: g++ ICE at -O1 and above on valid code on x86_64-linux-gnu in "copy_reference_ops_from_ref"

2016-03-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70144

Bug ID: 70144
   Summary: g++ ICE at -O1 and above on valid code on
x86_64-linux-gnu in "copy_reference_ops_from_ref"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current g++ trunk
at -O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It affects versions later than g++-4.7.  g++-4.6.4 works fine.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160308 (experimental) [trunk revision 234060] (GCC)


$ g++-trunk abc.cc -c
$ g++-trunk abc.cc -c -O1
abc.cc: In function ‘void fn1()’:
abc.cc:6:1: internal compiler error: in copy_reference_ops_from_ref, at
tree-ssa-sccvn.c:880
 }
 ^
0xed8283 copy_reference_ops_from_ref
../../gcc/gcc/tree-ssa-sccvn.c:880
0xed93f5 valueize_shared_reference_ops_from_ref
../../gcc/gcc/tree-ssa-sccvn.c:1501
0xed9d0a vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind,
vn_reference_s**, bool)
../../gcc/gcc/tree-ssa-sccvn.c:2250
0xedd901 visit_reference_op_load
../../gcc/gcc/tree-ssa-sccvn.c:3355
0xedd901 visit_use
../../gcc/gcc/tree-ssa-sccvn.c:3748
0xedff74 process_scc
../../gcc/gcc/tree-ssa-sccvn.c:3968
0xedff74 extract_and_process_scc_for_name
../../gcc/gcc/tree-ssa-sccvn.c:4055
0xedff74 DFS
../../gcc/gcc/tree-ssa-sccvn.c:4107
0xee082d sccvn_dom_walker::before_dom_children(basic_block_def*)
../../gcc/gcc/tree-ssa-sccvn.c:4574
0x13ac242 dom_walker::walk(basic_block_def*)
../../gcc/gcc/domwalk.c:265
0xee1662 run_scc_vn(vn_lookup_kind)
../../gcc/gcc/tree-ssa-sccvn.c:4685
0xeb3c54 execute
../../gcc/gcc/tree-ssa-pre.c:4895
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat abc.cc
void fn1() {
  __builtin_constant_p(__builtin_constant_p) ?: ({
unsigned tmp;
tmp;
  });
}

[Bug tree-optimization/70138] New: wrong code at -O3 on x86_64-linux-gnu

2016-03-08 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70138

Bug ID: 70138
   Summary: wrong code at -O3 on x86_64-linux-gnu
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The current gcc trunk mis-compiles the following code on x86_64-linux-gnu at
-O3 only in both 32-bit and 64-bit modes.

It should be a 6 regression.



$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160307 (experimental) [trunk revision 234026] (GCC)


$ gcc-trunk -O3 abc.c
$ ./a.out
Aborted (core dumped)
$ gcc-trunk  abc.c
$ ./a.out


$ cat abc.c
double u[1782225];
int a, b, d, e;
static void foo(int *p1) {
  double c = 0.0;
  for (; a < 1335; a++) {
b = 0;
for (; b < 1335; b++)
  c = c + u[a + 1335 * a];
u[1336 * a] *= 2;
  }
  *p1 = c;
}
void abort();
int main() {
  for (; d < 1782225; d++)
u[d] = 2;
  foo(&e);
  if (e != 3564450)
abort();
}

[Bug tree-optimization/70115] New: gcc ICE at -O2 (seg fault) and above on valid code on x86_64-linux-gnu

2016-03-07 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70115

Bug ID: 70115
   Summary: gcc ICE at -O2 (seg fault) and above on valid code on
x86_64-linux-gnu
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O2 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It also crashes gcc-5.X and 4.8. But 4.9 and 4.6 work fine.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160306 (experimental) [trunk revision 234013] (GCC)


$ gcc-trunk -O2 abc.c
abc.c: In function 'main':
abc.c:3:5: internal compiler error: Segmentation fault
 int main() {
 ^~~~
0xb5a3cf crash_signal
../../gcc/gcc/toplev.c:335
0x89d0cb contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3119
0x89d0cb fold_comparison
../../gcc/gcc/fold-const.c:8433
0x8826da fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
../../gcc/gcc/fold-const.c:3
0x8a0714 fold(tree_node*)
../../gcc/gcc/fold-const.c:12113
0xcb14b8 simplify_replace_tree
../../gcc/gcc/tree-ssa-loop-niter.c:1798
0xcb315c substitute_in_loop_info(loop*, tree_node*, tree_node*)
../../gcc/gcc/tree-ssa-loop-niter.c:4293
0xb96a17 replace_uses_by(tree_node*, tree_node*)
../../gcc/gcc/tree-cfg.c:1871
0xb97317 gimple_merge_blocks
../../gcc/gcc/tree-cfg.c:1938
0x7589b5 merge_blocks(basic_block_def*, basic_block_def*)
../../gcc/gcc/cfghooks.c:774
0xba0593 cleanup_tree_cfg_bb
../../gcc/gcc/tree-cfgcleanup.c:660
0xba0f56 cleanup_tree_cfg_1
../../gcc/gcc/tree-cfgcleanup.c:726
0xba0f56 cleanup_tree_cfg_noloop
../../gcc/gcc/tree-cfgcleanup.c:761
0xba0f56 cleanup_tree_cfg()
../../gcc/gcc/tree-cfgcleanup.c:812
0xc95459 tree_unroll_loops_completely(bool, bool)
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1369
0xc956d3 execute
../../gcc/gcc/tree-ssa-loop-ivcanon.c:1528
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
typedef int size_t;
char a;
int main() {
  size_t b, c;
  for (;;) {
b = 0;
for (; c;)
  ;
for (; b < sizeof(long); b++)
  ;
for (; b < c; b++)
  a++;
for (; c < b; c++)
  ;
  }
}

[Bug target/69773] gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "assign_by_spills"

2016-02-26 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69773

--- Comment #2 from Qirun Zhang  ---
pr65693 fails to compile at -O0 with the same (similar) trace.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160226 (experimental) [trunk revision 233763] (GCC) 



$ gcc-trunk pr65693.c 
pr65693.c: In function 'foo':
pr65693.c:13:1: error: unable to find a register to spill
 }
 ^
pr65693.c:13:1: error: this is the insn:
(insn 11 35 12 2 (parallel [
(set (reg:DI 96)
(udiv:DI (reg:DI 94)
(reg:DI 106)))
(set (reg:DI 107 [97])
(umod:DI (reg:DI 94)
(reg:DI 106)))
(clobber (reg:CC 17 flags))
]) pr65693.c:10 358 {*udivmoddi4}
 (expr_list:REG_UNUSED (reg:DI 107 [97])
(expr_list:REG_DEAD (reg:DI 106)
(expr_list:REG_DEAD (reg:DI 94)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))
pr65693.c:13:1: internal compiler error: in assign_by_spills, at
lra-assigns.c:1417
0xaf9138 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.c:108
0x9f4515 assign_by_spills
../../gcc/gcc/lra-assigns.c:1417
0x9f4bc3 lra_assign()
../../gcc/gcc/lra-assigns.c:1590
0x9f064b lra(_IO_FILE*)
../../gcc/gcc/lra.c:2331
0x9a76f9 do_reload
../../gcc/gcc/ira.c:5396
0x9a76f9 execute
../../gcc/gcc/ira.c:5567
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug rtl-optimization/69887] [4.9/5/6 Regression] gcc ICE at -O1 and above on x86_64-linux-gnu in mark_jump_label_1

2016-02-26 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69887

--- Comment #4 from Qirun Zhang  ---
(In reply to Eric Botcazou from comment #2)
> __builtin_longjmp cannot be used in the same function as __builtin_setjmp.
> 
> *** This bug has been marked as a duplicate of bug 59039 ***

But the original bug has been fixed by r204592, as mentioned by c#27 of
pr59039. The ICE in this report should be a new issue.

[Bug c/69974] New: gcc ICE on invalid code on x86_64-linux-gnu in "create_tmp_from_val"

2016-02-25 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69974

Bug ID: 69974
   Summary: gcc ICE on invalid code on x86_64-linux-gnu in
"create_tmp_from_val"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160225 (experimental) [trunk revision 233714] (GCC)



$ gcc-trunk abc.c
abc.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ')'
token
 char var1 );
   ^
abc.c: In function 'fn1':
abc.c:5:13: warning: implicit declaration of function 'var1'
[-Wimplicit-function-declaration]
 var3 &= var1 ( &var2
 ^~~~
abc.c:5:5: error: expected ')' at end of input
 var3 &= var1 ( &var2
 ^~~~
abc.c:5:5: error: expected declaration or statement at end of input
abc.c: At top level:
abc.c:2:11: error: storage size of 'var2' isn't known
 struct S1 var2;
   ^~~~
abc.c: In function 'fn1':
abc.c:5:13: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in create_tmp_from_val, at gimplify.c:497
 var3 &= var1 ( &var2

0xddd3b7 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9688
0x8f61ef tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/gcc/tree.h:3129
0x8f61ef create_tmp_from_val
../../gcc/gcc/gimplify.c:497
0x8f61ef lookup_tmp_var
../../gcc/gcc/gimplify.c:533
0x8f61ef internal_get_tmp_var
../../gcc/gcc/gimplify.c:563
0x8fc462 get_initialized_tmp_var(tree_node*, gimple**, gimple**)
../../gcc/gcc/gimplify.c:600
0x8fc462 gimplify_save_expr
../../gcc/gcc/gimplify.c:4979
0x8fc462 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10452
0x9015e6 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5644
0x9021f1 gimplify_compound_expr
../../gcc/gcc/gimplify.c:4934
0x8fe64c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10153
0x9015e6 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5644
0x902825 gimplify_bind_expr
../../gcc/gcc/gimplify.c:1142
0x8fc8b2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10363
0x9015e6 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5644
0x903444 gimplify_body(tree_node*, bool)
../../gcc/gcc/gimplify.c:11295
0x903ad6 gimplify_function_tree(tree_node*)
../../gcc/gcc/gimplify.c:11451
0x786e27 cgraph_node::analyze()
../../gcc/gcc/cgraphunit.c:625
0x78a193 analyze_functions
../../gcc/gcc/cgraphunit.c:1086
0x78aed8 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2540
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat abc.c
char var1 );
struct S1 var2;
int var3;
void fn1() {
var3 &= var1 ( &var2

[Bug tree-optimization/69951] New: wrong code at -O1 and above on x86_64-linux-gnu

2016-02-24 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69951

Bug ID: 69951
   Summary: wrong code at -O1 and above on x86_64-linux-gnu
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The current gcc trunk mis-compiles the following code on x86_64-linux-gnu at
-O1 and above in both 32-bit and 64-bit modes.

It affects as early as gcc-4.4.3 (I don't have earlier gcc on my machine).


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160224 (experimental) [trunk revision 233678] (GCC) 




$ gcc-trunk abc.c
$ ./a.out 
$ gcc-trunk -O1 abc.c
$ ./a.out 
Aborted (core dumped)



$ cat abc.c
int a = 1, c = 1;
extern int b __attribute__((alias("a")));
extern int d __attribute__((alias("c")));
int main(int argc) {
  int *p, *q;
  if (argc)
p = &c, q = &d;
  else
p = &b, q = &d;
  *p = 1;
  *q = 2;
  if (*p == 1)
__builtin_abort();
  return 0;
}

[Bug tree-optimization/69932] New: gcc ICE at -O1 and above on valid code on x86_64-linux-gnu with “seg fault”

2016-02-23 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69932

Bug ID: 69932
   Summary: gcc ICE at -O1 and above on valid code on
x86_64-linux-gnu with “seg fault”
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.


$ gcc-trunk  -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160223 (experimental) [trunk revision 233632] (GCC) 



$ gcc-trunk abc.c -c -O3
abc.c: In function ‘fn1’:
abc.c:8:1: internal compiler error: Segmentation fault
 }
 ^
0xb5ea1f crash_signal
../../gcc/gcc/toplev.c:335
0xbacab3 get_ref_base_and_extent(tree_node*, long*, long*, long*, bool*)
../../gcc/gcc/tree-dfa.c:392
0xc442da get_access_for_expr
../../gcc/gcc/tree-sra.c:2903
0xc4a97b sra_modify_assign
../../gcc/gcc/tree-sra.c:3314
0xc4a97b sra_modify_function_body
../../gcc/gcc/tree-sra.c:3621
0xc4a97b perform_intra_sra
../../gcc/gcc/tree-sra.c:3731
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
int a;
void fn1() {
  int b = 4;
  short c[4];
  c[b] = c[a];
  if (c[2]) {}

}

[Bug tree-optimization/69907] New: wrong code at -O3 on x86_64-linux-gnu

2016-02-22 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69907

Bug ID: 69907
   Summary: wrong code at -O3 on x86_64-linux-gnu
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The current gcc trunk mis-compiles PR49038.c on x86_64-linux at -O3 in both
32-bit and 64-bit modes. 

Below is a slightly reduced case.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160222 (experimental) [trunk revision 233601] (GCC)


$ gcc-trunk -O3 abc.c
$ ./a.out
Segmentation fault (core dumped)


$ cat abc.c
void *mmap();
void foo(unsigned *p1, unsigned short *p2) {
  int n;
  for (n = 0; n < 320; n++)
p1[n] = p2[n * 2];
}
int main() {
  void *x;
  long a;
  x = mmap(4432, 65536, 2, 2 | 32, 1, 0);
  a = 65536 - (2 * 320 - 1) * sizeof(short);
  foo(x, (unsigned short *)((char *)x + a));
}

[Bug inline-asm/69899] New: gcc ICE on invalid code on x86_64-linux-gnu in "replace_reg"

2016-02-21 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69899

Bug ID: 69899
   Summary: gcc ICE on invalid code on x86_64-linux-gnu in
"replace_reg"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current gcc
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes.


It crashes gcc from version 4.4.7 to trunk. gcc-4.4.3 seems to be fine.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160221 (experimental) [trunk revision 233594] (GCC)


$ gcc-trunk abc.c
abc.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
 fn1() { asm("" : "=t"(a) : "0u"(0)); }
 ^~~
abc.c: In function 'fn1':
abc.c:2:1: internal compiler error: in replace_reg, at reg-stack.c:687
0xac8c4f replace_reg
../../gcc/gcc/reg-stack.c:686
0xaca85b subst_asm_stack_regs
../../gcc/gcc/reg-stack.c:2137
0xaccb2d subst_stack_regs
../../gcc/gcc/reg-stack.c:2302
0xaccd68 convert_regs_1
../../gcc/gcc/reg-stack.c:2951
0xaccd68 convert_regs_2
../../gcc/gcc/reg-stack.c:3086
0xacdb8a convert_regs
../../gcc/gcc/reg-stack.c:3121
0xacdb8a reg_to_stack
../../gcc/gcc/reg-stack.c:3250
0xacdb8a rest_of_handle_stack_regs
../../gcc/gcc/reg-stack.c:3305
0xacdb8a execute
../../gcc/gcc/reg-stack.c:3336
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
double a;
fn1() { asm("" : "=t"(a) : "0u"(0)); }

[Bug tree-optimization/69740] [5/6 Regression] gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "verify_loop_structure"

2016-02-21 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69740

--- Comment #3 from Qirun Zhang  ---
(In reply to Jakub Jelinek from comment #1)
> Started with r218566.

Here is a similar case. The stack trace is almost the same as in the original
RP's. However, this one crashes the current trunk at -O3 only (The original RP
still crashes the current trunk at -O2 and above).

I am not sure if this is a dup of the original RP..


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160221 (experimental) [trunk revision 233594] (GCC)

$ gcc-trunk -O2 abc.c
$ gcc-trunk -Os abc.c
$ gcc-trunk -O3 abc.c
abc.c: In function 'main':
abc.c:7:5: error: loop with header 5 not in loop tree
 int main() {
 ^~~~
abc.c:7:5: internal compiler error: in verify_loop_structure, at cfgloop.c:1639
0x75e6bf verify_loop_structure()
../../gcc/gcc/cfgloop.c:1639
0x9d9e9e checking_verify_loop_structure
../../gcc/gcc/cfgloop.h:324
0x9d9e9e loop_optimizer_init(unsigned int)
../../gcc/gcc/loop-init.c:106
0xd198dd execute
../../gcc/gcc/tree-ssa-sink.c:619
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


$ cat abc.c
inline int foo(int *p1, int p2) {
  int z = *p1;
  while (z > p2)
p2 = 2;
  return z;
}
int main() {
  int i;
  for (;;) {
int j, k;
i = foo(&k, 7);
if (k)
  j = i;
else
  k = j;
if (2 != j)
  __builtin_abort();
  }
}

[Bug tree-optimization/69887] New: gcc ICE at -O1 and above on x86_64-linux-gnu in mark_jump_label_1

2016-02-20 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69887

Bug ID: 69887
   Summary: gcc ICE at -O1 and above on x86_64-linux-gnu in
mark_jump_label_1
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It affects gcc-4.6 to trunk.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160220 (experimental) [trunk revision 233587] (GCC)





$ gcc-trunk -O1 abc.c
abc.c: In function 'main':
abc.c:6:1: internal compiler error: in mark_jump_label_1, at jump.c:1159
 }
 ^
0x9d50a9 mark_jump_label_1
../../gcc/gcc/jump.c:1159
0x9d4e8a mark_jump_label_1
../../gcc/gcc/jump.c:1219
0x9d5485 mark_all_labels
../../gcc/gcc/jump.c:313
0x9d5485 rebuild_jump_labels_1
../../gcc/gcc/jump.c:75
0x11da8c1 rest_of_handle_cse
../../gcc/gcc/cse.c:7538
0x11da8c1 execute
../../gcc/gcc/cse.c:7572
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.c
int a[1];
int main() {
  __builtin_setjmp(a);
  __builtin_longjmp(a, 1);
  return 0;
}

[Bug tree-optimization/69811] New: A gcc folding issue at -O0

2016-02-13 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69811

Bug ID: 69811
   Summary: A gcc folding issue at -O0
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

Starting from 5.1, the gcc-trunk at -O0 does not perform constant folding for
the following example.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160213 (experimental) [trunk revision 233402] (GCC)


$ cat abc.c
extern void aabb (void);
int main ()
{
  if (0 == "a"+1)
aabb ();
  return 0;
}

$ gcc-4.9 -O0 abc.c
$ gcc-trunk -O0 abc.c
/tmp/cc00w34u.o: In function `main':
abc.c:(.text+0xf): undefined reference to `aabb'
collect2: error: ld returned 1 exit status



As a result, the current gcc-trunk may emit a call to function aabb().

$ cat abc.c
void aabb (void){}
int main ()
{
  if (0== "a" +1)
aabb ();
  return 0;
}

$ gcc-4.9 -O0 abc.c
$ objdump -d a.out | grep aabb
004004f6 :


And for trunk version:
$ gcc-trunk -O0 abc.c
$ objdump -d a.out | grep aabb
00400496 :
  4004ab:   e8 e6 ff ff ff  callq  400496 

[Bug tree-optimization/69802] New: gcc ICE at -O1 and above on valid code on x86_64-linux-gnu with “seg fault”

2016-02-12 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69802

Bug ID: 69802
   Summary: gcc ICE at -O1 and above  on valid code on
x86_64-linux-gnu with “seg fault”
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It might be a regression from 4.7.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160212 (experimental) [trunk revision 233377] (GCC)




$ gcc-trunk abc.c -c -O3
abc.c: In function 'fn1':
abc.c:5:5: internal compiler error: Segmentation fault
 int fn1() {
 ^~~
0xb5df2f crash_signal
../../gcc/gcc/toplev.c:335
0x8d12c9 bb_seq_addr
../../gcc/gcc/gimple.h:1654
0x8d12c9 gsi_start_bb
../../gcc/gcc/gimple-iterator.h:129
0x8d12c9 gsi_for_stmt(gimple*)
../../gcc/gcc/gimple-iterator.c:617
0xcf4a27 update_range_test
../../gcc/gcc/tree-ssa-reassoc.c:2099
0xcfc178 optimize_range_tests
../../gcc/gcc/tree-ssa-reassoc.c:2638
0xd0034d reassociate_bb
../../gcc/gcc/tree-ssa-reassoc.c:4882
0xcfffb7 reassociate_bb
../../gcc/gcc/tree-ssa-reassoc.c:4960
0xd026ba do_reassoc
../../gcc/gcc/tree-ssa-reassoc.c:5074
0xd026ba execute_reassoc
../../gcc/gcc/tree-ssa-reassoc.c:5161
0xd026ba execute
../../gcc/gcc/tree-ssa-reassoc.c:5200
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.c
struct S {
  unsigned f1 : 1;
};
int d, a;
int fn1() {
  unsigned b = 0;
  struct S c;
  d = ((1 && b) < c.f1) & c.f1;
  return a;
}

[Bug tree-optimization/69801] New: gcc ICE on valid code on x86_64-linux-gnu in "operand_equal_p"

2016-02-12 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69801

Bug ID: 69801
   Summary: gcc ICE  on valid code on x86_64-linux-gnu in
"operand_equal_p"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
on x86_64-linux-gnu in both 32-bit and 64-bit modes.



(*) But a nearly identical case can pass.



$ gcc-trunk  -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160212 (experimental) [trunk revision 233377] (GCC)



$ gcc-trunk abc.c -c
abc.c: In function 'fn1':
abc.c:5:1: internal compiler error: in operand_equal_p, at fold-const.c:2776
 void fn1() { e ? (d ? b : c).c : (d ? b : c).c; }
 ^~~~
0x872dc5 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
../../gcc/gcc/fold-const.c:2776
0x871c2e operand_equal_p(tree_node const*, tree_node const*, unsigned int)
../../gcc/gcc/fold-const.c:2982
0x872378 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
../../gcc/gcc/fold-const.c:3123
0x8714c6 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
../../gcc/gcc/fold-const.c:3067
0x8711ca operand_equal_p(tree_node const*, tree_node const*, unsigned int)
../../gcc/gcc/fold-const.c:3091
0xf5ff61 generic_simplify_COND_EXPR
/home/absozero/trunk/build-gcc/gcc/generic-match.c:26035
0xf5ff61 generic_simplify(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*, tree_node*)
/home/absozero/trunk/build-gcc/gcc/generic-match.c:26273
0x87e93c fold_ternary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*, tree_node*)
../../gcc/gcc/fold-const.c:11406
0x880ee3 fold_build3_stat_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*, tree_node*)
../../gcc/gcc/fold-const.c:12506
0x68b7e3 c_fully_fold_internal
../../gcc/gcc/c/c-fold.c:506
0x68cd4b c_fully_fold(tree_node*, bool, bool*)
../../gcc/gcc/c/c-fold.c:90
0x629a0f c_process_expr_stmt(unsigned int, tree_node*)
../../gcc/gcc/c/c-typeck.c:10231
0x629e0d c_finish_expr_stmt(unsigned int, tree_node*)
../../gcc/gcc/c/c-typeck.c:10276
0x6770d0 c_parser_statement_after_labels
../../gcc/gcc/c/c-parser.c:5275
0x678d5b c_parser_compound_statement_nostart
../../gcc/gcc/c/c-parser.c:4859
0x6795de c_parser_compound_statement
../../gcc/gcc/c/c-parser.c:4695
0x675144 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:2107
0x68089d c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1551
0x6812c9 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1429
0x6812c9 c_parse_file()
../../gcc/gcc/c/c-parser.c:17826
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



$ cat abc.c
struct {
  char c[1];
} b, c;
int d, e;
void fn1() { e ? (d ? b : c).c : (d ? b : c).c; }



A nearly identical case:
$ diff abc.c a.c
5c5
< void fn1() { e ? (d ? b : c).c : (d ? b : c).c; }
---
> void fn1() { e ? (d ? b : c).c : (e ? b : c).c; }

$ gcc-trunk a.c -c

Syntactically, variables d and e should be treated in the same way.

[Bug c++/69795] New: g++ ICE on invalid code on x86_64-linux-gnu in "reject_gcc_builtin"

2016-02-12 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69795

Bug ID: 69795
   Summary: g++ ICE on invalid code on x86_64-linux-gnu in
"reject_gcc_builtin"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current g++
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160212 (experimental) [trunk revision 233377] (GCC) 



$ g++-trunk abc.cc
abc.cc:1:27: error: expected end of capture-list
 int freopen ( freopen += *[
   ^
abc.cc: In lambda function:
abc.cc:1:27: error: expected ‘{’ at end of input
abc.cc: At global scope:
abc.cc:1:27: internal compiler error: tree check: expected function_decl, have
var_decl in reject_gcc_builtin, at c-family/c-common.c:12620
0xfb074c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9637
0x89cf16 tree_check(tree_node const*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3262
0x89cf16 reject_gcc_builtin(tree_node const*, unsigned int)
../../gcc/gcc/c-family/c-common.c:12620
0x668f1c mark_rvalue_use(tree_node*, unsigned int, bool)
../../gcc/gcc/cp/expr.c:99
0x7eaa74 rvalue(tree_node*)
../../gcc/gcc/cp/tree.c:716
0x7eadad stabilize_expr(tree_node*, tree_node**)
../../gcc/gcc/cp/tree.c:4209
0x7805bf cp_build_modify_expr(tree_node*, tree_code, tree_node*, int)
../../gcc/gcc/cp/typeck.c:7704
0x62f275 build_new_op_1
../../gcc/gcc/cp/call.c:5740
0x62fa4e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
../../gcc/gcc/cp/call.c:5824
0x781ceb build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
../../gcc/gcc/cp/typeck.c:7899
0x7416f6 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9095
0x741877 cp_parser_constant_expression
../../gcc/gcc/cp/parser.c:9324
0x742e2a cp_parser_parenthesized_expression_list
../../gcc/gcc/cp/parser.c:7454
0x7438d6 cp_parser_initializer
../../gcc/gcc/cp/parser.c:20730
0x7552dd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:18594
0x755beb cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12359
0x755f7a cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12235
0x75ecde cp_parser_declaration
../../gcc/gcc/cp/parser.c:12132
0x75d646 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12011
0x75d958 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4321
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.




$ cat abc.cc
int freopen ( freopen += *[

[Bug c++/69793] New: g++ ICE on invalid code on x86_64-linux-gnu in "cp_lexer_peek_nth_token"

2016-02-12 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69793

Bug ID: 69793
   Summary: g++ ICE on invalid code on x86_64-linux-gnu in
"cp_lexer_peek_nth_token"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current g++
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160212 (experimental) [trunk revision 233377] (GCC) 



$ g++-trunk abc.cc
abc.cc:2:12: error: ‘state’ has not been declared
 template < state > bool operator!= (fpos,; operator!=
^
abc.cc:2:42: error: expected identifier before ‘;’ token
 template < state > bool operator!= (fpos,; operator!=
  ^
abc.cc:2:42: error: expected ‘)’ before ‘;’ token
abc.cc:2:52: internal compiler error: in cp_lexer_peek_nth_token, at
cp/parser.c:1055
 template < state > bool operator!= (fpos,; operator!=
^~
0x7249d2 cp_lexer_peek_nth_token
../../gcc/gcc/cp/parser.c:1055
0x7478af cp_parser_template_id
../../gcc/gcc/cp/parser.c:14829
0x748e9a cp_parser_type_name
../../gcc/gcc/cp/parser.c:16364
0x737451 cp_parser_type_name
../../gcc/gcc/cp/parser.c:16335
0x737451 cp_parser_simple_type_specifier
../../gcc/gcc/cp/parser.c:16249
0x7334ad cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:15902
0x7486e1 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:12745
0x755b31 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12288
0x755f7a cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12235
0x75ecde cp_parser_declaration
../../gcc/gcc/cp/parser.c:12132
0x75d646 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12011
0x75d958 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4321
0x75d958 c_parse_file()
../../gcc/gcc/cp/parser.c:37383
0x8b6632 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.cc
class fpos;
template < state > bool operator!= (fpos,; operator!=

[Bug target/44551] [missed optimization] AVX vextractf128 after vinsertf128

2016-02-11 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44551

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #15 from Qirun Zhang  ---
This regression crashes the current trunk.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160211 (experimental) [trunk revision 233345] (GCC) 


$ gcc-trunk pr44551-1.c 
pr44551-1.c: In function ‘foo’:
pr44551-1.c:7:1: note: The ABI for passing parameters with 32-byte alignment
has changed in GCC 4.6
 foo (__m256i x, __m128i y)
 ^~~
pr44551-1.c:7:1: warning: AVX vector argument without AVX enabled changes the
ABI [-Wpsabi]
In file included from
/home/absozero/trunk/root-gcc/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include/immintrin.h:41:0,
 from pr44551-1.c:4:
pr44551-1.c:9:15: error: ‘__builtin_ia32_vinsertf128_si256’ needs isa option
-m32
   __m256i r = _mm256_insertf128_si256(x, y, 1);
   ^
pr44551-1.c:9:15: internal compiler error: in emit_move_insn, at expr.c:3546
0x851c6f emit_move_insn(rtx_def*, rtx_def*)
../../gcc/gcc/expr.c:3545
0x85859d store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
../../gcc/gcc/expr.c:5583
0x859b88 expand_assignment(tree_node*, tree_node*, bool)
../../gcc/gcc/expr.c:5175
0x74dd8a expand_call_stmt
../../gcc/gcc/cfgexpand.c:2646
0x74dd8a expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.c:3536
0x74dd8a expand_gimple_stmt
../../gcc/gcc/cfgexpand.c:3702
0x74fbe8 expand_gimple_basic_block
../../gcc/gcc/cfgexpand.c:5708
0x755bf6 execute
../../gcc/gcc/cfgexpand.c:6323
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

[Bug target/21255] %R and %S are not safe to use from asms

2016-02-11 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21255

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #9 from Qirun Zhang  ---
This regression crashes the current trunk.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160211 (experimental) [trunk revision 233345] (GCC) 



$ gcc-trunk pr21255-3.c 
pr21255-3.c: In function ‘f’:
pr21255-3.c:13:1: internal compiler error: in ix86_print_operand, at
config/i386/i386.c:17094
 }
 ^
0xea8432 ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc/gcc/config/i386/i386.c:17094
0x86830c output_operand(rtx_def*, int)
../../gcc/gcc/final.c:3843
0x868db7 output_asm_insn(char const*, rtx_def**)
../../gcc/gcc/final.c:3740
0x86aa03 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc/gcc/final.c:2624
0x86b012 final(rtx_insn*, _IO_FILE*, int)
../../gcc/gcc/final.c:2045
0x86b7c9 rest_of_handle_final
../../gcc/gcc/final.c:4441
0x86b7c9 execute
../../gcc/gcc/final.c:4516
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

[Bug regression/67278] ICE: verify_gimple failed on darwin 14.5 x86_64

2016-02-11 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67278

Qirun Zhang  changed:

   What|Removed |Added

 CC||helloqirun at gmail dot com

--- Comment #1 from Qirun Zhang  ---
This regression also crashes the current trunk.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160211 (experimental) [trunk revision 233345] (GCC) 



$ gcc-trunk pr65491_1.c 
pr65491_1.c: In function ‘sum’:
pr65491_1.c:7:1: error: mode precision of non-integral result does not match
field size of BIT_FIELD_REF
 sum (a first, a second)
 ^~~
BIT_FIELD_REF 
pr65491_1.c:9:16: note: in statement
   return first + second;
  ~~^~~~
_6 = BIT_FIELD_REF ;
pr65491_1.c:7:1: error: mode precision of non-integral result does not match
field size of BIT_FIELD_REF
 sum (a first, a second)
 ^~~
BIT_FIELD_REF 
pr65491_1.c:9:16: note: in statement
   return first + second;
  ~~^~~~
_7 = BIT_FIELD_REF ;
pr65491_1.c:7:1: internal compiler error: verify_gimple failed
 sum (a first, a second)
 ^~~
0xb9f6a6 verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5125
0xa92c73 execute_function_todo
../../gcc/gcc/passes.c:1958
0xa9354b execute_todo
../../gcc/gcc/passes.c:2010
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

[Bug tree-optimization/69773] New: gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "assign_by_spills"

2016-02-11 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69773

Bug ID: 69773
   Summary: gcc ICE at -O2 and above on valid code on
x86_64-linux-gnu in "assign_by_spills"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O2 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160211 (experimental) [trunk revision 233345] (GCC)


$ gcc-trunk -c -O2 abc.c
abc.c: In function 'fn2':
abc.c:18:1: error: unable to find a register to spill
 }
 ^
abc.c:18:1: error: this is the insn:
(insn 11 30 29 3 (parallel [
(set (reg:SI 101 [95])
(truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 102
[100]))
(sign_extend:DI (reg:SI 96)))
(const_int 32 [0x20]
(clobber (reg:SI 102 [100]))
(clobber (reg:CC 17 flags))
]) abc.c:8 341 {*smulsi3_highpart_1}
 (expr_list:REG_UNUSED (reg:SI 102 [100])
(expr_list:REG_DEAD (reg:SI 96)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_EQUAL (truncate:SI (lshiftrt:DI (mult:DI
(sign_extend:DI (reg:SI 94 [ MEM[(struct str *)&f] ]))
(const_int 1374389535 [0x51eb851f]))
(const_int 32 [0x20])))
(nil))
abc.c:18:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1417
0xaf7f38 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.c:108
0x9f3575 assign_by_spills
../../gcc/gcc/lra-assigns.c:1417
0x9f3c23 lra_assign()
../../gcc/gcc/lra-assigns.c:1590
0x9ef6ab lra(_IO_FILE*)
../../gcc/gcc/lra.c:2322
0x9a6939 do_reload
../../gcc/gcc/ira.c:5395
0x9a6939 execute
../../gcc/gcc/ira.c:5566
Please submit a full bug report,
with preprocessed source if appropriate.


$ cat abc.c
struct str {
  int k;
} f;
int g, a;
int fn1(struct str *p1) {
  a = ({
register __typeof__(0) c asm("rdx");
g = p1->k / 100;
c;
  });
  return 0;
}
int fn2() {
  struct str h = f;
  if (g)
fn1(&h);
  return 0;
}

[Bug tree-optimization/69740] New: gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "verify_loop_structure"

2016-02-09 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69740

Bug ID: 69740
   Summary: gcc ICE at -O2 and above on valid code on
x86_64-linux-gnu in "verify_loop_structure"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at -O2 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160209 (experimental) [trunk revision 233242] (GCC)



$ gcc-trunk abc.c -c
$ gcc-trunk abc.c -c -O2
abc.c: In function 'fn1':
abc.c:12:1: error: loop with header 4 not in loop tree
 }
 ^
abc.c:12:1: internal compiler error: in verify_loop_structure, at
cfgloop.c:1639
0x75e2ff verify_loop_structure()
../../gcc/gcc/cfgloop.c:1639
0x9d95ae checking_verify_loop_structure
../../gcc/gcc/cfgloop.h:324
0x9d95ae loop_optimizer_init(unsigned int)
../../gcc/gcc/loop-init.c:106
0xaaed32 execute
../../gcc/gcc/predict.c:3033
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


——
$ cat abc.c
char a;
short b;
void fn1() {
  if (b)
;
  else {
int c[1] = {0};
  l1:;
  }
  if (a)
goto l1;
}

[Bug tree-optimization/69666] [5/6 Regression] gcc ICE at -O2 and -O3 on valid code on x86_64-linux-gnu in "verify_gimple failed"

2016-02-04 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69666

--- Comment #5 from Qirun Zhang  ---
(In reply to Jakub Jelinek from comment #4)
> (In reply to Qirun Zhang from comment #3)
> > (In reply to Jakub Jelinek from comment #2)
> > > This invalid VCE is created by SRA.  The code has multiple undefined
> > > behaviors in it, but we shouldn't ICE on that.
> > 
> > Hi Jakub,
> > 
> > This code example is reduced from a file from ghostscript. Therefore, I
> > assume the original test case should not have any undefined behavior. If
> > helpful, I can attach the original pre-processed file which triggers the
> > same ICE.
> 
> Why do you think ghostscript doesn't have undefined behavior in it?
> Anyway, the bugs are both store of e[16] (only &e[16] is valid, but not
> dereferencing it), and memcpy of 16 characters to c which has only sizeof
> (int) (usually 4) characters.

Ah.. I forgot that I have modified that file. Please ignore my previous
message.

[Bug tree-optimization/69666] [5/6 Regression] gcc ICE at -O2 and -O3 on valid code on x86_64-linux-gnu in "verify_gimple failed"

2016-02-03 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69666

--- Comment #3 from Qirun Zhang  ---
(In reply to Jakub Jelinek from comment #2)
> This invalid VCE is created by SRA.  The code has multiple undefined
> behaviors in it, but we shouldn't ICE on that.

Hi Jakub,

This code example is reduced from a file from ghostscript. Therefore, I assume
the original test case should not have any undefined behavior. If helpful, I
can attach the original pre-processed file which triggers the same ICE.

  1   2   >