[Bug c/93572] New: internal compiler error: q from h referenced in main

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93572

Bug ID: 93572
   Summary: internal compiler error: q from h referenced in main
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
struct s { int x ;
 double y ;
 } short main ( ) { int x ;
 int h ( x , y ) char arr [ ( 1 , 2 ) - ( ( 1 , 2 ) / 2 ) * 2 ] [ sizeof 0 ] ,
( * p ) [ ] , * q ;
 int v [ & q != 2 ] ;
 2 * ( 3 + 4 ) ;
 x = x & ( 6 / ( 6 / 114 / 2 ) / 2 ) ;
 return x - 1 ;
 }
---

GCC version:
---
gcc -v
Using built-in specs.
COLLECT_GCC=/mnt/raidhhd/gcc_instr_install/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/raidhhd/gcc_instr_install/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200127 (experimental) (GCC)
---

CMD:
---
gcc -o tmp poc.c
---

[Bug c/93573] New: internal compiler error: in force_constant_size, at gimplify.c:733

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573

Bug ID: 93573
   Summary: internal compiler error: in force_constant_size, at
gimplify.c:733
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int f1 ( char * p ) ( ) { int x ;
 x = 4 ;
 if ( ! x != 10 ) return 1 ;
 if ( ( sum ( 1 , 2 ) / 2 ) != 1 ) return 1 ;
 if ( - ( 2 * sum ( 3 , 4 ) + sum ( ( union foo { int i , X [ 2 ] [ - (
100.00 / 2 ) * 2 ] , k ;
 char * p ;
 float ( * f1 ( int a , int b ) ) ( int c , int b ) ;
 } ) p , 2 ) ) != 0 - 4 ) return 1 ;
 return 0 ;
 }
---

Gcc version:
---
Using built-in specs.
COLLECT_GCC=/mnt/raidhhd/gcc_instr_install/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/raidhhd/gcc_instr_install/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200127 (experimental) (GCC)
---

CMD:
---
gcc -o tmp poc.c
---

[Bug c/93574] New: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_expr_sizeof_expr, at c/c-typeck.c:2925

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93574

Bug ID: 93574
   Summary: internal compiler error: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
c_expr_sizeof_expr, at c/c-typeck.c:2925
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
struct s { struct { void y ;
 int z ;
 } x [ 3 + 4 ] ;
 double y ;
 } main ( ) { int x ;
 x = -- x != 1 > 0 ;
 x = ( ( 6 / ( ( 0 * sum ( 3 , 4 ) + ( 1 , 2 ) ) / 114 / 2 ) / 2 ) ) > 0 & ( x
== sizeof ( ( int * ( * ( int f ( struct list ) ) ) [ * * main ] ) 1 ) ) ;
 return x - 1 ;
 }
---

GCC version:
---
Using built-in specs.
COLLECT_GCC=/mnt/raidhhd/gcc_instr_install/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/raidhhd/gcc_instr_install/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200127 (experimental) (GCC)
---

CMD:
---
gcc -o tmp poc.c
---

[Bug c/93576] New: internal compiler error: Segmentation fault (in gimplify.c)

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

Bug ID: 93576
   Summary: internal compiler error: Segmentation fault (in
gimplify.c)
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int main ( ) { int x [ ] = { 1 , e } ;
 return x [ ( ( char ) p % ( sizeof ( 0 ) < main ) >= ( ( ( char * ( * ( * (
int ( struct list ) ) ) [ ! ( 1 , 2 * ( 3 , ! x != ( 1 , sizeof ( char * ) < (
( 1 , 2 ) / 2 != 7 , 2 ) ) ) ) ] ) [ * * main ] ) p + 4 ) >= & x [ 12 ] ) ) ] ;
 }
---

GCC version:
---
Using built-in specs.
COLLECT_GCC=/mnt/raidhhd/gcc_instr_install/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/raidhhd/gcc_instr_install/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200127 (experimental) (GCC)
---

CMD line:
---
gcc -o tmp poc.c
---

[Bug c/93577] New: internal compiler error: tree check: expected integer_cst, have non_lvalue_expr in get_len, at tree.h:5902

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93577

Bug ID: 93577
   Summary: internal compiler error: tree check: expected
integer_cst, have non_lvalue_expr in get_len, at
tree.h:5902
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int main ( ) { int x [ ] = { 1 , } ;
 struct s { int x [ 16 == ( ( ( sizeof ( ( 3 , f ( ) > 1000 < 5000 < 2 ) ) / 2
) != x > ( 6 / 3 / 2 ) ) ) ] ;
 struct { int tag ;
 struct { int tag ;
 union { struct { struct obj * car , * cdr ;
 } i ;
 double r ;
 char * sl ;
 } u ;
 int a [ 3.14 != 2 && 0 ] ;
 } u ;
 int z ;
 } nest ;
 } g_207 = { 1 , 2 , 3 } ;
 return f == a ;
 }
---

GCC version:
---
Using built-in specs.
COLLECT_GCC=/mnt/raidhhd/gcc_instr_install/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/raidhhd/gcc_instr_install/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.1 20200127 (experimental) (GCC)
---

CMD line:
---
gcc -o tmp poc.c
---

[Bug middle-end/93576] [10 Regression] internal compiler error: Segmentation fault (in gimplify.c)

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

--- Comment #2 from Yongheng Chen  ---
Hi Martin,

I included the CMD line "gcc -o tmp poc.c" in the report but not the stack
dump. Is the stack dump necessary? I didn't include it because I think the POC
is enough to reproduce the problem and the report will look cleaner without the
stack dump.

[Bug middle-end/93576] [10 Regression] internal compiler error: Segmentation fault (in gimplify.c)

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

--- Comment #3 from Yongheng Chen  ---
It seems I overwrote Andrew Pinski's comment by mistake. Sorry about that LOL

[Bug middle-end/93576] [10 Regression] internal compiler error: Segmentation fault (in gimplify.c)

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93576

--- Comment #6 from Yongheng Chen  ---
I see. I will do it for future bugs.

[Bug c/93572] internal compiler error: q from h referenced in main

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93572

--- Comment #1 from Yongheng Chen  ---
Stack dump:
---
tt.c:3:4: error: expected ‘;’, identifier or ‘(’ before ‘short’
3 |  } short main ( ) { int x ;
  |^
tt.c: In function ‘h’:
tt.c:5:14: warning: comparison between pointer and integer
5 |  int v [ & q != 2 ] ;
  |  ^~
tt.c:6:2: error: expected declaration specifiers before numeric constant
6 |  2 * ( 3 + 4 ) ;
  |  ^
tt.c:7:2: error: expected declaration specifiers before ‘x’
7 |  x = x & ( 6 / ( 6 / 114 / 2 ) / 2 ) ;
  |  ^
tt.c:8:2: error: expected declaration specifiers before ‘return’
8 |  return x - 1 ;
  |  ^~
tt.c:9:2: error: expected declaration specifiers before ‘}’ token
9 |  }
  |  ^
tt.c:4:6: warning: type of ‘x’ defaults to ‘int’ [-Wimplicit-int]
4 |  int h ( x , y ) char arr [ ( 1 , 2 ) - ( ( 1 , 2 ) / 2 ) * 2 ] [
sizeof 0 ] , ( * p ) [ ] , * q ;
  |  ^
tt.c:4:6: warning: type of ‘y’ defaults to ‘int’ [-Wimplicit-int]
tt.c:5:6: error: declaration for parameter ‘v’ but no such parameter
5 |  int v [ & q != 2 ] ;
  |  ^
tt.c:4:96: error: declaration for parameter ‘q’ but no such parameter
4 |  int h ( x , y ) char arr [ ( 1 , 2 ) - ( ( 1 , 2 ) / 2 ) * 2 ] [
sizeof 0 ] , ( * p ) [ ] , * q ;
  |
   ^
tt.c:4:84: error: declaration for parameter ‘p’ but no such parameter
4 |  int h ( x , y ) char arr [ ( 1 , 2 ) - ( ( 1 , 2 ) / 2 ) * 2 ] [
sizeof 0 ] , ( * p ) [ ] , * q ;
  |
   ^
tt.c:4:23: error: declaration for parameter ‘arr’ but no such parameter
4 |  int h ( x , y ) char arr [ ( 1 , 2 ) - ( ( 1 , 2 ) / 2 ) * 2 ] [
sizeof 0 ] , ( * p ) [ ] , * q ;
  |   ^~~
tt.c:9: error: expected ‘{’ at end of input
9 |  }
  |
tt.c: In function ‘main’:
tt.c:9:2: error: expected declaration or statement at end of input
9 |  }
  |  ^
tt.c:3:10: internal compiler error: q from h referenced in main
3 |  } short main ( ) { int x ;
  |  ^~~~
0xe74559 convert_nonlocal_reference_op
../../gcc/tree-nested.c:1063
0x108af7a walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void
*, hash_set >*))
../../gcc/tree.c:11954
0xe742ed convert_nonlocal_reference_op
../../gcc/tree-nested.c:1105
0x108af7a walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void
*, hash_set >*))
../../gcc/tree.c:11954
0xb11f20 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.c:202
0xb1230c walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.c:596
0xb124a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.c:51
0xb12391 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.c:686
0xb124a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.c:51
0xe6fc94 walk_body
../../gcc/tree-nested.c:713
0xe6fc94 walk_function
../../gcc/tree-nested.c:724
0xe6fc94 walk_all_functions
../../gcc/tree-nested.c:789
0xe76008 lower_nested_functions(tree_node*)
../../gcc/tree-nested.c:3528
0x98c4dc cgraph_node::analyze()
../../gcc/cgraphunit.c:675
0x98f19f analyze_functions
../../gcc/cgraphunit.c:1210
0x98fd62 symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.c:2956
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
---

[Bug c/93573] internal compiler error: in force_constant_size, at gimplify.c:733

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573

--- Comment #1 from Yongheng Chen  ---
Stack dump:
---
tt.c:1:5: error: ‘f1’ declared as function returning a function
1 | int f1 ( char * p  ) ( ) { int x ;
  | ^~
tt.c: In function ‘f1’:
tt.c:4:9: warning: implicit declaration of function ‘sum’
[-Wimplicit-function-declaration]
4 |  if ( ( sum ( 1 , 2  ) / 2  ) != 1  ) return 1 ;
  | ^~~
tt.c:5:60: error: size of array ‘X’ has non-integer type
5 |  if ( - ( 2 * sum ( 3 , 4  ) + sum ( ( union foo { int i , X [ 2  ] [ -
( 100.00 / 2  ) * 2  ] , k ;
  |^
tt.c:7:34: error: field ‘f1’ declared as a function
7 |float ( * f1 ( int a , int b  )  ) ( int c , int
b  ) ;
  |  ^~
tt.c:5:32: internal compiler error: in force_constant_size, at gimplify.c:733
5 |  if ( - ( 2 * sum ( 3 , 4  ) + sum ( ( union foo { int i , X [ 2  ] [ -
( 100.00 / 2  ) * 2  ] , k ;
  |   
^
6 |   char * p ;
  |   ~~
7 |float ( * f1 ( int a , int b  )  ) ( int c , int
b  ) ;
  |   
~~~
8 | }  ) p , 2  )  ) != 0 - 4  ) return 1 ;
  | ~
0x69d4dc force_constant_size
../../gcc/gimplify.c:733
0xb1b637 gimple_add_tmp_var(tree_node*)
../../gcc/gimplify.c:771
0xae9287 create_tmp_var(tree_node*, char const*)
../../gcc/gimple-expr.c:485
0xb2d5df create_tmp_from_val
../../gcc/gimplify.c:561
0xb2d5df lookup_tmp_var
../../gcc/gimplify.c:582
0xb2d5df internal_get_tmp_var
../../gcc/gimplify.c:635
0xb26ccf get_formal_tmp_var(tree_node*, gimple**)
../../gcc/gimplify.c:663
0xb26ccf gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14582
0xb287c6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14030
0xb314b4 gimplify_expr
../../gcc/gimplify.c:14628
0xb5 gimplify_call_expr
../../gcc/gimplify.c:3497
0xb28467 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:13553
0xb27790 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14350
0xb27757 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14348
0xb3cdbb gimplify_cond_expr
../../gcc/gimplify.c:4177
0xb27ece gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:13538
0xb2af96 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.c:6822
0xb2885b gimplify_statement_list
../../gcc/gimplify.c:1869
0xb2885b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14025
0xb2af96 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.c:6822
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
---

[Bug c/93574] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_expr_sizeof_expr, at c/c-typeck.c:2925

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93574

--- Comment #1 from Yongheng Chen  ---
Stack dump:
---
tt.c:1:26: error: variable or field ‘y’ declared void
1 | struct s { struct { void y ;
  |  ^
tt.c: In function ‘main’:
tt.c:7:23: warning: implicit declaration of function ‘sum’
[-Wimplicit-function-declaration]
7 |   x = ( ( 6 / ( ( 0 * sum ( 3 , 4  ) + ( 1 , 2  )  ) / 114 / 2  ) / 2 
)  ) > 0 & ( x == sizeof ( ( int * ( * ( int f ( struct list  )  )  ) [ * *
main  ]  ) 1  )  ) ;
  |   ^~~
tt.c:7:128: warning: ‘struct list’ declared inside parameter list will not be
visible outside of this definition or declaration
7 |   x = ( ( 6 / ( ( 0 * sum ( 3 , 4  ) + ( 1 , 2  )  ) / 114 / 2  ) / 2 
)  ) > 0 & ( x == sizeof ( ( int * ( * ( int f ( struct list  )  )  ) [ * *
main  ]  ) 1  )  ) ;
  |
   ^~~~
tt.c:7:128: error: size of unnamed array has non-integer type
tt.c:7:99: error: cast specifies function type
7 |   x = ( ( 6 / ( ( 0 * sum ( 3 , 4  ) + ( 1 , 2  )  ) / 114 / 2  ) / 2 
)  ) > 0 & ( x == sizeof ( ( int * ( * ( int f ( struct list  )  )  ) [ * *
main  ]  ) 1  )  ) ;
  |
  ^
tt.c:7:128: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_expr_sizeof_expr, at c/c-typeck.c:2925
7 |   x = ( ( 6 / ( ( 0 * sum ( 3 , 4  ) + ( 1 , 2  )  ) / 114 / 2  ) / 2 
)  ) > 0 & ( x == sizeof ( ( int * ( * ( int f ( struct list  )  )  ) [ * *
main  ]  ) 1  )  ) ;
  |
   ^~~~
0x7610ae tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/tree.c:9735
0x625ebb tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/tree.h:3401
0x625ebb c_expr_sizeof_expr(unsigned int, c_expr)
../../gcc/c/c-typeck.c:2925
0x862167 c_parser_sizeof_expression
../../gcc/c/c-parser.c:8341
0x862167 c_parser_unary_expression
../../gcc/c/c-parser.c:8238
0x862dad c_parser_cast_expression
../../gcc/c/c-parser.c:8108
0x8631b1 c_parser_binary_expression
../../gcc/c/c-parser.c:8034
0x864025 c_parser_conditional_expression
../../gcc/c/c-parser.c:7645
0x864640 c_parser_expr_no_commas
../../gcc/c/c-parser.c:7562
0x8648a1 c_parser_expression
../../gcc/c/c-parser.c:10630
0x85d495 c_parser_postfix_expression
../../gcc/c/c-parser.c:9121
0x86155a c_parser_unary_expression
../../gcc/c/c-parser.c:8266
0x862dad c_parser_cast_expression
../../gcc/c/c-parser.c:8108
0x8631b1 c_parser_binary_expression
../../gcc/c/c-parser.c:8034
0x864025 c_parser_conditional_expression
../../gcc/c/c-parser.c:7645
0x864640 c_parser_expr_no_commas
../../gcc/c/c-parser.c:7562
0x8646ea c_parser_expr_no_commas
../../gcc/c/c-parser.c:7604
0x8648a1 c_parser_expression
../../gcc/c/c-parser.c:10630
0x865047 c_parser_expression_conv
../../gcc/c/c-parser.c:10663
0x85a90b c_parser_statement_after_labels
../../gcc/c/c-parser.c:6294
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
---

[Bug c/93577] internal compiler error: tree check: expected integer_cst, have non_lvalue_expr in get_len, at tree.h:5902

2020-02-04 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93577

--- Comment #1 from Yongheng Chen  ---
Stack dump:
---
tt.c: In function ‘main’:
tt.c:2:48: warning: implicit declaration of function ‘f’
[-Wimplicit-function-declaration]
2 |  struct s { int x [ 16 == ( ( ( sizeof ( ( 3 , f ( ) > 1000 < 5000 < 2 
)  ) / 2  ) != x > ( 6 / 3 / 2  )  )  )  ] ;
  |^
tt.c:2:90: warning: comparison between pointer and integer
2 |  struct s { int x [ 16 == ( ( ( sizeof ( ( 3 , f ( ) > 1000 < 5000 < 2 
)  ) / 2  ) != x > ( 6 / 3 / 2  )  )  )  ] ;
  |
 ^
tt.c:14:3: error: variable-sized object may not be initialized
   14 |   } g_207 = { 1 , 2 , 3  } ;
  |   ^
tt.c:14:15: warning: excess elements in array initializer
   14 |   } g_207 = { 1 , 2 , 3  } ;
  |   ^
tt.c:14:15: note: (near initialization for ‘g_207.x’)
tt.c:14:3: internal compiler error: tree check: expected integer_cst, have
non_lvalue_expr in get_len, at tree.h:5902
   14 |   } g_207 = { 1 , 2 , 3  } ;
  |   ^
0x760c33 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9685
0x82393a tree_check(tree_node const*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3534
0x82393a wi::extended_tree<192>::get_len() const
../../gcc/tree.h:5902
0x82393a wi::int_traits >
>::decompose(long*, unsigned int, generic_wide_int >
const&)
../../gcc/wide-int.h:985
0x82393a wide_int_ref_storage::wide_int_ref_storage >
>(generic_wide_int > const&, unsigned int)
../../gcc/wide-int.h:1034
0x82393a generic_wide_int
>::generic_wide_int >
>(generic_wide_int > const&, unsigned int)
../../gcc/wide-int.h:790
0x82393a bool wi::lts_p >,
generic_wide_int >
>(generic_wide_int > const&,
generic_wide_int > const&)
../../gcc/wide-int.h:1901
0x836cb2 wi::binary_traits >,
generic_wide_int >,
wi::int_traits > >::precision_type,
wi::int_traits >
>::precision_type>::signed_predicate_result operator<
 >,
generic_wide_int >
>(generic_wide_int > const&,
generic_wide_int<$i::extended_tree<192> > const&)
../../gcc/wide-int.h:3248
0x836cb2 tree_int_cst_lt(tree_node const*, tree_node const*)
../../gcc/tree.h:6058
0x836cb2 find_init_member
../../gcc/c/c-typeck.c:9434
0x836dde push_init_level(unsigned int, int, obstack*)
../../gcc/c/c-typeck.c:8433
0x8444d7 process_init_element(unsigned int, c_expr, bool, obstack*)
../../gcc/c/c-typeck.c:10200
0x86614f c_parser_initval
../../gcc/c/c-parser.c:5533
0x866410 c_parser_initelt
../../gcc/c/c-parser.c:5505
0x866410 c_parser_braced_init
../../gcc/c/c-parser.c:5273
0x8674b3 c_parser_initializer
../../gcc/c/c-parser.c:5221
0x879bf3 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2249
0x85cec7 c_parser_compound_statement_nostart
../../gcc/c/c-parser.c:5713
0x879348 c_parser_compound_statement
../../gcc/c/c-parser.c:5616
0x87adcb c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2504
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
---

[Bug c/93631] New: internal compiler error: in gimple_ca ll_arg, at gimple.h:3258

2020-02-07 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93631

Bug ID: 93631
   Summary: internal compiler error: in gimple_ca ll_arg, at
gimple.h:3258
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
---

Run command:
---
gcc -o poc poc.c
---

Gcc version:
---
gcc (GCC) 10.0.1 20200208 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
---

Stack dump:
---
internal compiler error: in gimple_ca
ll_arg, at gimple.h:3258
1 | int f2 ( int x [ strcmp ( ) ] , int b ) { return c - b ;
  | ^~
0x696d12 gimple_call_arg
../../gcc/gimple.h:3258
0x69ae3a gimple_call_arg
../../gcc/tree.h:3799
0x69ae3a gimple_call_arg
../../gcc/gimple.h:3266
0x69ae3a gimple_fold_builtin_string_compare
../../gcc/gimple-fold.c:2382
0xafbc7d gimple_fold_builtin
../../gcc/gimple-fold.c:3966
0xafbc7d gimple_fold_call
../../gcc/gimple-fold.c:4481
0xafd2f3 fold_stmt_1
../../gcc/gimple-fold.c:5152
0x169fc97 lower_stmt
../../gcc/gimple-low.c:388
0x169f7f2 lower_sequence
../../gcc/gimple-low.c:217
0x169f7f2 lower_gimple_bind
../../gcc/gimple-low.c:474
0x16a08f9 lower_function_body
../../gcc/gimple-low.c:110
0x16a08f9 execute
../../gcc/gimple-low.c:195
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
---

[Bug c/93631] internal compiler error: in gimple_ca ll_arg, at gimple.h:3258

2020-02-07 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93631

--- Comment #1 from Yongheng Chen  ---
POC:
---
int f2 ( int x [ strcmp ( ) ] , int b ) { return c - b ;
 }
 int ( * f1 ( int a , enum E2 { E = -2 , F , G , H }
 b ) ) ( int c , int b ) { if ( a != b ) return f2 ;
 return 0 ;
 }
 int main ( ) { int ( * ( * p ) ( int a , int b ) ) ( int c , int d ) = f1 ;
 return ( * ( * p ) ( 0 , 2 ) ) ( 2 , 2 ) ;
 }
---

[Bug c++/93752] New: internal compiler error: in pop_local_binding, at cp/name-lookup.c:2036

2020-02-14 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93752

Bug ID: 93752
   Summary: internal compiler error: in pop_local_binding, at
cp/name-lookup.c:2036
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int main ( void ) {
struct s1 {
int s ;
struct s2 {
int tbl[ sizeof ( struct s ) ] ;
} ;
};
return 0 ;
}
---

Run script:
---
g++ -o poc poc.cpp
---

Stack dump:
---
 int main()
./poc.c:5:22: error: invalid application of ‘sizeof’ to incomplete type
‘main()::s’
5 | int tbl[ sizeof ( struct s ) ] ;
  |  ^~~
./poc.c:8:14: internal compiler error: in pop_local_binding, at
cp/name-lookup.c:2036
8 | return 0 ;
  |  ^
0x69dfd6 pop_local_binding(tree_node*, tree_node*)
../../gcc/cp/name-lookup.c:2036
0x96d266 poplevel(int, int, int)
../../gcc/cp/decl.c:702
0xa8710b do_poplevel(tree_node*)
../../gcc/cp/semantics.c:452
0xa8ac49 finish_compound_stmt(tree_node*)
../../gcc/cp/semantics.c:1541
0x9fc574 cp_parser_compound_statement
../../gcc/cp/parser.c:11745
0xa132d5 cp_parser_function_body
../../gcc/cp/parser.c:22981
0xa132d5 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.c:23032
0xa1662d cp_parser_function_definition_after_declarator
../../gcc/cp/parser.c:28880
0xa17636 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.c:28796
0xa17636 cp_parser_init_declarator
../../gcc/cp/parser.c:20596
0x9f8be0 cp_parser_simple_declaration
../../gcc/cp/parser.c:13678
0xa217d2 cp_parser_declaration
../../gcc/cp/parser.c:13377
0xa21f52 cp_parser_translation_unit
../../gcc/cp/parser.c:4731
0xa21f52 c_parse_file()
../../gcc/cp/parser.c:43709
0xb361eb c_common_parse_file()
../../gcc/c-family/c-opts.c:1186
Please submit a full bug report,
---

[Bug c++/93753] New: internal compiler error: in output_constructor_regular_field, at varasm.c:5255

2020-02-14 Thread changochen1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93753

Bug ID: 93753
   Summary: internal compiler error: in
output_constructor_regular_field, at varasm.c:5255
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
struct {
int mem [ ] ;
int b ;
} s = {1};
---

run script:
---
g++ -o poc poc.cpp
---

g++ version:
---
g++ (GCC) 10.0.1 20200214 (experimental)
---

Stack dump:
---
poc.cpp:4:10: internal compiler error: in output_constructor_regular_field, at
varasm.c:5255
4 | } s = {1};
  |  ^
0x836f9b output_constructor_regular_field
../../gcc/varasm.c:5255
0x836f9b output_constructor
../../gcc/varasm.c:5536
0x1311bcd output_constant
../../gcc/varasm.c:4908
0x1311bcd assemble_variable_contents
../../gcc/varasm.c:2148
0x1317158 assemble_variable(tree_node*, int, int, int)
../../gcc/varasm.c:2327
0x131a9d9 varpool_node::assemble_decl()
../../gcc/varpool.c:587
0xbe50cc output_in_order
../../gcc/cgraphunit.c:2564
0xbe50cc symbol_table::compile()
../../gcc/cgraphunit.c:2801
0xbe733c symbol_table::compile()
../../gcc/cgraphunit.c:2717
0xbe733c symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.c:2984
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
---

[Bug c++/93788] New: Segfault caused by infinite loop in cc1plus

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

Bug ID: 93788
   Summary: Segfault caused by infinite loop in cc1plus
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int a{[] ( struct {
---

Run script:
---
cc1plus poc.c
---

Stack dump only says segemantation fault. When I debugged I found the segfault
is caused by an invalid stack address, which results from infinite loop:
---
#18499 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279
#18500 0x0098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 ) at ../../gcc/tree.h:3298
#18501 0x0098e894 in dump_scope (scope=,
flags=, pp=0x2804cc0 ) at
../../gcc/cp/error.c:209
#18502 0x00987655 in dump_aggr_type (t=, flags=0x0,
pp=0x2804cc0 ) at ../../gcc/tree.h:3393
#18503 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279
#18504 0x0098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 ) at ../../gcc/tree.h:3298
#18505 0x0098e894 in dump_scope (scope=,
flags=, pp=0x2804cc0 ) at
../../gcc/cp/error.c:209
#18506 0x00987655 in dump_aggr_type (t=, flags=0x0,
pp=0x2804cc0 ) at ../../gcc/tree.h:3393
#18507 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279
#18508 0x0098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 ) at ../../gcc/tree.h:3298
#18509 0x0098e894 in dump_scope (scope=,
flags=, pp=0x2804cc0 ) at
../../gcc/cp/error.c:209
#18510 0x00987655 in dump_aggr_type (t=, flags=0x0,
pp=0x2804cc0 ) at ../../gcc/tree.h:3393
#18511 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279
#18512 0x0098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 ) at ../../gcc/tree.h:3298
#18513 0x0098e894 in dump_scope (scope=,
flags=, pp=0x2804cc0 ) at
../../gcc/cp/error.c:209
#18514 0x00987655 in dump_aggr_type (t=, flags=0x0,
pp=0x2804cc0 ) at ../../gcc/tree.h:3393
#18515 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279
#18516 0x0098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 ) at ../../gcc/tree.h:3298
#18517 0x0098e894 in dump_scope (scope=,
flags=, pp=0x2804cc0 ) at
../../gcc/cp/error.c:209
#18518 0x00987655 in dump_aggr_type (t=, flags=0x0,
pp=0x2804cc0 ) at ../../gcc/tree.h:3393
#18519 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279
#18520 0x0098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 ) at ../../gcc/tree.h:3298
#18521 0x0098e894 in dump_scope (scope=,
flags=, pp=0x2804cc0 ) at
../../gcc/cp/error.c:209
#18522 0x00987655 in dump_aggr_type (t=, flags=0x0,
pp=0x2804cc0 ) at ../../gcc/tree.h:3393
#18523 0x0098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 ) at ../../gcc/tree.h:3279

---

[Bug c++/93789] New: internal compiler error: in tree_to_uhwi, at tree.c:7361

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

Bug ID: 93789
   Summary: internal compiler error: in tree_to_uhwi, at
tree.c:7361
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
void f ( ) {
const int tbl [ ( long ) "h" ] = { 12 };
}
---

Rum script:
---
cc1plus -o poc poc.c
---

Stack dump:
---
test1.c: In function ‘void f()’:   
   
[8/1813]
test1.c:2:43: internal compiler error: in tree_to_uhwi, at tree.c:7361
2 | const int tbl [ ( long ) "h" ] = { 12 };
  |   ^
0x8293cb tree_to_uhwi(tree_node const*)
../../gcc/tree.c:7361
0x8293cb tree_to_uhwi(tree_node const*)
../../gcc/tree.c:7359
0x94c9c9 reshape_init_array_1
../../gcc/cp/decl.c:6010
0x94b5b4 reshape_init(tree_node*, tree_node*, int)
../../gcc/cp/decl.c:6518
0x94d9dc check_initializer
../../gcc/cp/decl.c:6702
0x9712ce cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.c:7746
0xa17034 cp_parser_init_declarator
../../gcc/cp/parser.c:20828
0x9f8be0 cp_parser_simple_declaration
../../gcc/cp/parser.c:13678
0x9fa95a cp_parser_declaration_statement
../../gcc/cp/parser.c:13110
0x9fb566 cp_parser_statement
../../gcc/cp/parser.c:11423
0x9fc488 cp_parser_statement_seq_opt
../../gcc/cp/parser.c:11789
0x9fc568 cp_parser_compound_statement
../../gcc/cp/parser.c:11739
0xa132d5 cp_parser_function_body
../../gcc/cp/parser.c:22981
0xa132d5 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.c:23032
0xa1662d cp_parser_function_definition_after_declarator
../../gcc/cp/parser.c:28880
0xa17636 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.c:28796
0xa17636 cp_parser_init_declarator
../../gcc/cp/parser.c:20596
0x9f8be0 cp_parser_simple_declaration
../../gcc/cp/parser.c:13678
...
---