[Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc

2023-04-24 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109619

Bug ID: 109619
   Summary: ICE: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in fold_const_call_1, at
fold-const-call.cc
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ gcc --version
gcc (GCC) 13.0.1 20230219 (experimental)
Copyright (C) 2023 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.



$ cat 4.c 

void foo(void *a1, const void *a2, long unsigned int a3)
{
  void *x = __builtin_memcpy(a1, a2, a3);
  int *a3 = __builtin_memmove(a1, a2, a3);
}



$ gcc 4.c 
4.c: In function ‘foo’:
4.c:5:8: error: ‘a3’ redeclared as different kind of symbol
5 |   int *a3 = __builtin_memmove(a1, a2, a3);
  |^~
4.c:2:54: note: previous definition of ‘a3’ with type ‘long unsigned int’
2 | void foo(void *a1, const void *a2, long unsigned int a3)
  |~~^~
4.c:4:13: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc:1800
4 |   void *x = __builtin_memcpy(a1, a2, a3);
  | ^~~~
0x840637 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-13-20230219/gcc/tree.cc:8959
0x776846 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-13-20230219/gcc/tree.h:3653
0x776846 fold_const_call_1
../../gcc-13-20230219/gcc/fold-const-call.cc:1800
0x776846 fold_const_call(combined_fn, tree_node*, tree_node*, tree_node*,
tree_node*)
../../gcc-13-20230219/gcc/fold-const-call.cc:1903
0xa66a98 fold_builtin_3
../../gcc-13-20230219/gcc/builtins.cc:9851
0xa66a98 fold_builtin_n
../../gcc-13-20230219/gcc/builtins.cc:9932
0xc97037 gimplify_call_expr
../../gcc-13-20230219/gcc/gimplify.cc:3684
0xc88500 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16333
0xc9a465 gimplify_modify_expr
../../gcc-13-20230219/gcc/gimplify.cc:6153
0xc879e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16361
0xc8a316 gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc97d34 gimplify_and_add(tree_node*, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:492
0xc97d34 gimplify_decl_expr
../../gcc-13-20230219/gcc/gimplify.cc:1936
0xc88132 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16558
0xc8a316 gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc88c38 gimplify_statement_list
../../gcc-13-20230219/gcc/gimplify.cc:2019
0xc88c38 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16806
0xc8a316 gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc8aa47 gimplify_bind_expr
../../gcc-13-20230219/gcc/gimplify.cc:1430
0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16562
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c/109618] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in generic_simplify_CONVERT_EXPR, at generic-match.cc

2023-04-24 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109618

Bug ID: 109618
   Summary: ICE: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in
generic_simplify_CONVERT_EXPR, at generic-match.cc
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int foo()
{
  const unsigned int var_1 = 2;

  char var_5[var_1];

  int var_1[10];

  return sizeof(var_5);
}




$ gcc --version
gcc (GCC) 13.0.1 20230219 (experimental)
Copyright (C) 2023 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 test.c  
test.c: In function ‘foo’:
test.c:8:7: error: conflicting type qualifiers for ‘var_1’
8 |   int var_1[10];
  |   ^
test.c:4:22: note: previous definition of ‘var_1’ with type ‘unsigned int’
4 |   const unsigned int var_1 = 2;
  |  ^
test.c :10:3: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in generic_simplify_CONVERT_EXPR, at
generic-match.cc:28499
   10 |   return sizeof(var_5);
  |   ^~
0x840637 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-13-20230219/gcc/tree.cc:8959
0x8abac0 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-13-20230219/gcc/tree.h:3653
0x8abac0 generic_simplify_CONVERT_EXPR
gcc-13-20230219-build/gcc/generic-match.cc:28499
0xbf6848 fold_unary_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../gcc-13-20230219/gcc/fold-const.cc:9341
0xbf8079 fold_build1_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../gcc-13-20230219/gcc/fold-const.cc:13778
0x9429bb c_expr_sizeof_expr(unsigned int, c_expr)
../../gcc-13-20230219/gcc/c/c-typeck.cc:3096
0x97ef46 c_parser_sizeof_expression
../../gcc-13-20230219/gcc/c/c-parser.cc:8910
0x97ef46 c_parser_unary_expression
../../gcc-13-20230219/gcc/c/c-parser.cc:8803
0x97fdef c_parser_cast_expression
../../gcc-13-20230219/gcc/c/c-parser.cc:8672
0x9800df c_parser_binary_expression
../../gcc-13-20230219/gcc/c/c-parser.cc:8440
0x98154b c_parser_conditional_expression
../../gcc-13-20230219/gcc/c/c-parser.cc:8138
0x981d24 c_parser_expr_no_commas
../../gcc-13-20230219/gcc/c/c-parser.cc:8052
0x981fd1 c_parser_expression
../../gcc-13-20230219/gcc/c/c-parser.cc:11379
0x982717 c_parser_expression_conv
../../gcc-13-20230219/gcc/c/c-parser.cc:11419
0x97858b c_parser_statement_after_labels
../../gcc-13-20230219/gcc/c/c-parser.cc:6674
0x9798e4 c_parser_compound_statement_nostart
../../gcc-13-20230219/gcc/c/c-parser.cc:6296
0x99f164 c_parser_compound_statement
../../gcc-13-20230219/gcc/c/c-parser.cc:6105
0x9a10cb c_parser_declaration_or_fndef
../../gcc-13-20230219/gcc/c/c-parser.cc:2841
0x9a8a1b c_parser_external_declaration
../../gcc-13-20230219/gcc/c/c-parser.cc:1925
0x9a93f3 c_parser_translation_unit
../../gcc-13-20230219/gcc/c/c-parser.cc:1779
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c/109598] New: ICE: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc

2023-04-22 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109598

Bug ID: 109598
   Summary: ICE: tree check: expected array_type, have error_mark
in array_ref_low_bound, at tree.cc
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

gcc (GCC) 13.0.1 20230219 snapshot ICEs when compiling the following testcase

$ gcc --version
gcc (GCC) 13.0.1 20230219 (experimental)
Copyright (C) 2023 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.



$ cat 2.c

extern char g[];

char *foo(void)
{
  return [0];
}

char *g(void)
{
  return [1];
}



$ gcc 2.c 
2.c:9:7: error: ‘g’ redeclared as different kind of symbol
9 | char *g(void)
  |   ^
2.c:2:13: note: previous declaration of ‘g’ with type ‘char[]’
2 | extern char g[];
  | ^
2.c: In function ‘g’:
2.c:11:12: error: subscripted value is neither array nor pointer nor vector
   11 |   return [1];
  |^
2.c: In function ‘foo’:
2.c:6:12: internal compiler error: tree check: expected array_type, have
error_mark in array_ref_low_bound, at tree.cc:12782
6 |   return [0];
  |   ~^~~
0x840178 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc-13-20230219/gcc/tree.cc:8909
0x8499ae tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc-13-20230219/gcc/tree.h:3530
0x8499ae array_ref_low_bound(tree_node*)
../../gcc-13-20230219/gcc/tree.cc:12782
0xc8caf9 gimplify_compound_lval
../../gcc-13-20230219/gcc/gimplify.cc:3219
0xc875fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16313
0xc8e602 gimplify_addr_expr
../../gcc-13-20230219/gcc/gimplify.cc:6561
0xc8805d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16408
0xc9a465 gimplify_modify_expr
../../gcc-13-20230219/gcc/gimplify.cc:6153
0xc879e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16361
0xc8a316 gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc96670 gimplify_and_add(tree_node*, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:492
0xc96670 gimplify_return_expr
../../gcc-13-20230219/gcc/gimplify.cc:1680
0xc87d0a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16623
0xc8a316 gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc8aa47 gimplify_bind_expr
../../gcc-13-20230219/gcc/gimplify.cc:1430
0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16562
0xca912e gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xca912e gimplify_body(tree_node*, bool)
../../gcc-13-20230219/gcc/gimplify.cc:17623
0xca958a gimplify_function_tree(tree_node*)
../../gcc-13-20230219/gcc/gimplify.cc:17822
0xad7fa7 cgraph_node::analyze()
../../gcc-13-20230219/gcc/cgraphunit.cc:676
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c/109597] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c

2023-04-22 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109597

Bug ID: 109597
   Summary: ICE: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in
useless_type_conversion_p, at gimple-expr.c
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

gcc (GCC) 13.0.1 20230219 snapshot ICEs when compiling the following testcase

$ cat 1.c 

extern int x[4];

extern int y[4];

void foo(void)
{
  void bar(int [4]);
}

void bar(void [x]);

void baz(void)
{
  bar(y);
}



$ gcc --version
gcc (GCC) 13.0.1 20230219 (experimental)
Copyright (C) 2023 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 1.c

error: declaration of type name as array of voids
   11 | void bar(void [x]);
  |   ^
1.c: In function ‘baz’:
1.c:15:7: error: type of formal parameter 1 is incomplete
   15 |   bar(y);
  |   ^
1.c:15:3: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.cc:259
   15 |   bar(y);
  |   ^~~
0x840637 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-13-20230219/gcc/tree.cc:8959
0x77c162 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-13-20230219/gcc/tree.h:3653
0x77c162 useless_type_conversion_p(tree_node*, tree_node*)
../../gcc-13-20230219/gcc/gimple-expr.cc:259
0xc8e710 types_compatible_p(tree_node*, tree_node*)
../../gcc-13-20230219/gcc/gimple-expr.h:67
0xc8e710 gimplify_addr_expr
../../gcc-13-20230219/gcc/gimplify.cc:6584
0xc8805d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16408
0xc96b14 gimplify_call_expr
../../gcc-13-20230219/gcc/gimplify.cc:3711
0xc88500 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16333
0xc8a316 gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc8aa47 gimplify_bind_expr
../../gcc-13-20230219/gcc/gimplify.cc:1430
0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-13-20230219/gcc/gimplify.cc:16562
0xca912e gimplify_stmt(tree_node**, gimple**)
../../gcc-13-20230219/gcc/gimplify.cc:7219
0xca912e gimplify_body(tree_node*, bool)
../../gcc-13-20230219/gcc/gimplify.cc:17623
0xca958a gimplify_function_tree(tree_node*)
../../gcc-13-20230219/gcc/gimplify.cc:17822
0xad7fa7 cgraph_node::analyze()
../../gcc-13-20230219/gcc/cgraphunit.cc:676
0xadaaf7 analyze_functions
../../gcc-13-20230219/gcc/cgraphunit.cc:1238
0xadb78d symbol_table::finalize_compilation_unit()
../../gcc-13-20230219/gcc/cgraphunit.cc:2545
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c/101858] New: [12 Regression] ICE: ‘verify_gimple’ failed

2021-08-11 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101858

Bug ID: 101858
   Summary: [12 Regression] ICE: ‘verify_gimple’ failed
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int foo(a)
{
if ( a < (int*)(1LL << a))
a = 0;

return a;
}



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210729 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c: In function ‘foo’:
test.c:2:5: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
2 | int foo(a)
  | ^~~
test.c:4:12: warning: comparison between pointer and integer
4 | if ( a < (int*)(1LL << a))
  |^
test.c:2:5: error: type mismatch in ‘rshift_expr’
2 | int foo(a)
  | ^~~
int *
int *
int
_3 = _2 >> a;
test.c:2:5: internal compiler error: ‘verify_gimple’ failed
0xecbccd verify_gimple_in_seq(gimple*)
../../gcc-12-20210801/gcc/tree-cfg.c:5183
0xbe644a gimplify_body(tree_node*, bool)
../../gcc-12-20210801/gcc/gimplify.c:15539
0xbe657d gimplify_function_tree(tree_node*)
../../gcc-12-20210801/gcc/gimplify.c:15610
0xa1ed77 cgraph_node::analyze()
../../gcc-12-20210801/gcc/cgraphunit.c:670
0xa218f7 analyze_functions
../../gcc-12-20210801/gcc/cgraphunit.c:1234
0xa225bd symbol_table::finalize_compilation_unit()
../../gcc-12-20210801/gcc/cgraphunit.c:2508
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210717
Copyright (C) 2021 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-sp11 test.c 
test.c: In function ‘foo’:
test.c:2:5: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
2 | int foo(a)
  | ^~~
test.c:4:12: warning: comparison between pointer and integer
4 | if ( a < (int*)(1LL << a))
  |^
/usr/bin/ld: /lib/x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status

[Bug c/101702] New: [12 Regression] ICE: in handle_argspec_attribute, at c-family/c-attribs.c:3623

2021-07-30 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101702

Bug ID: 101702
   Summary: [12 Regression] ICE: in handle_argspec_attribute, at
c-family/c-attribs.c:3623
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 44.c 

double foo(double x[!__builtin_copysignf(~2, 3)]);

double bar(double x)
{
  return foo(x);
}



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210718 (experimental)
Copyright (C) 2021 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-sp12 44.c 
44.c:2:1: internal compiler error: in handle_argspec_attribute, at
c-family/c-attribs.c:3623
2 | double foo(double x[!__builtin_copysignf(~2, 3)]);
  | ^~
0x69526e handle_argspec_attribute
../../gcc-12-20210718/gcc/c-family/c-attribs.c:3623
0x873fcc decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc-12-20210718/gcc/attribs.c:720
0x891fc2 push_parm_decl(c_parm const*, tree_node**)
../../gcc-12-20210718/gcc/c/c-decl.c:5903
0x8e9a39 c_parser_parms_list_declarator
../../gcc-12-20210718/gcc/c/c-parser.c:4291
0x8e9d88 c_parser_parms_declarator
../../gcc-12-20210718/gcc/c/c-parser.c:4217
0x8e1e48 c_parser_direct_declarator_inner
../../gcc-12-20210718/gcc/c/c-parser.c:4130
0x8ee858 c_parser_declaration_or_fndef
../../gcc-12-20210718/gcc/c/c-parser.c:2148
0x8f7773 c_parser_external_declaration
../../gcc-12-20210718/gcc/c/c-parser.c:1777
0x8f81b9 c_parser_translation_unit
../../gcc-12-20210718/gcc/c/c-parser.c:1650
0x8f81b9 c_parse_file()
../../gcc-12-20210718/gcc/c/c-parser.c:22121
0x957cbd c_common_parse_file()
../../gcc-12-20210718/gcc/c-family/c-opts.c:1223
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210717
Copyright (C) 2021 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-sp11 44.c 
44.c: In function ‘bar’:
44.c:6:14: error: incompatible type for argument 1 of ‘foo’
6 |   return foo(x);
  |  ^
  |  |
  |  double
44.c:2:19: note: expected ‘double *’ but argument is of type ‘double’
2 | double foo(double x[!__builtin_copysignf(~2, 3)]);
  |~~~^~

[Bug c/101437] New: [12 Regression] ICE: Segmentation fault signal terminated program cc1

2021-07-13 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101437

Bug ID: 101437
   Summary: [12 Regression] ICE: Segmentation fault signal
terminated program cc1
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

struct s
{
  unsigned int : 1;
};

inline static void foo(int x)
{
  struct s this_struct = {.var = x};
  *((volatile struct s *) 0x88UL) = this_struct;
}

void bar()
{
  foo(0);
}



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210711 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c: In function ‘foo’:
test.c:9:28: error: ‘struct s’ has no member named ‘var’
9 |   struct s this_struct = {.var = x};
  |^~~
test.c:9:34: warning: excess elements in struct initializer
9 |   struct s this_struct = {.var = x};
  |  ^
test.c:9:34: note: (near initialization for ‘this_struct’)
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210710
Copyright (C) 2021 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-sp11 test.c 
test.c: In function ‘foo’:
test.c:9:28: error: ‘struct s’ has no member named ‘var’
9 |   struct s this_struct = {.var = x};
  |^~~
test.c:9:34: warning: excess elements in struct initializer
9 |   struct s this_struct = {.var = x};
  |  ^
test.c:9:34: note: (near initialization for ‘this_struct’)

[Bug c/101365] New: [12 Regression] ICE: in fold_convert_loc, at fold-const.c:243

2021-07-07 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101365

Bug ID: 101365
   Summary: [12 Regression] ICE: in fold_convert_loc, at
fold-const.c:243
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int var_0;

void func_0()
{
  var_0++;
}

int var_0[] = {1};



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210704 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c:9:5: error: conflicting types for ‘var_0’; have ‘int[]’
9 | int var_0[] = {1};
  | ^
test.c:2:5: note: previous declaration of ‘var_0’ with type ‘int’
2 | int var_0;
  | ^
test.c: In function ‘func_0’:
test.c:6:8: internal compiler error: in fold_convert_loc, at fold-const.c:2431
6 |   var_0++;
  |   ~^~
0x6d5399 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc-12-20210704/gcc/fold-const.c:2431
0xbddc1e gimplify_self_mod_expr(tree_node**, gimple**, gimple**, bool,
tree_node*)
../../gcc-12-20210704/gcc/gimplify.c:3204
0xbc77b8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210704/gcc/gimplify.c:14140
0xbcb3f6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210704/gcc/gimplify.c:6869
0xbcbb4d gimplify_bind_expr
../../gcc-12-20210704/gcc/gimplify.c:1426
0xbc96ae gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210704/gcc/gimplify.c:14411
0xbe0f59 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210704/gcc/gimplify.c:6869
0xbe0f59 gimplify_body(tree_node*, bool)
../../gcc-12-20210704/gcc/gimplify.c:15442
0xbe139d gimplify_function_tree(tree_node*)
../../gcc-12-20210704/gcc/gimplify.c:15596
0xa202e7 cgraph_node::analyze()
../../gcc-12-20210704/gcc/cgraphunit.c:670
0xa22d17 analyze_functions
../../gcc-12-20210704/gcc/cgraphunit.c:1234
0xa239bd symbol_table::finalize_compilation_unit()
../../gcc-12-20210704/gcc/cgraphunit.c:2508
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210703
Copyright (C) 2021 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-sp11 test.c 
test.c:9:5: error: conflicting types for ‘var_0’; have ‘int[]’
9 | int var_0[] = {1};
  | ^
test.c:2:5: note: previous declaration of ‘var_0’ with type ‘int’
2 | int var_0;
  | ^
test.c:6: confused by earlier errors, bailing out

[Bug c/101364] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_type_promotes_to, at c/c-typeck.c:278

2021-07-07 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101364

Bug ID: 101364
   Summary: [12 Regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
c_type_promotes_to, at c/c-typeck.c:278
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void fruit();

struct Apple{
  int apple[4];
};

void fruit(
struct Apple a,
int b[x],
unsigned char c)
{
  return 0;
}



$ gcc-sp12 --version 
gcc (GCC) 12.0.0 20210704 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c:10:11: error: ‘x’ undeclared here (not in a function)
   10 | int b[x],
  |   ^
test.c:8:6: error: conflicting types for ‘fruit’; have ‘void(struct Apple, 
,  unsigned char)’
8 | void fruit(
  |  ^
test.c:12:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_type_promotes_to, at c/c-typeck.c:278
   12 | {
  | ^
0x7ad81c tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-12-20210704/gcc/tree.c:8734
0x668e82 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-12-20210704/gcc/tree.h:3496
0x668e82 c_type_promotes_to(tree_node*)
../../gcc-12-20210704/gcc/c/c-typeck.c:278
0x874d07 diagnose_arglist_conflict
../../gcc-12-20210704/gcc/c/c-decl.c:1826
0x874d07 diagnose_mismatched_decls
../../gcc-12-20210704/gcc/c/c-decl.c:2134
0x8767e4 duplicate_decls
../../gcc-12-20210704/gcc/c/c-decl.c:2956
0x8791a9 pushdecl(tree_node*)
../../gcc-12-20210704/gcc/c/c-decl.c:3149
0x88c359 start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc-12-20210704/gcc/c/c-decl.c:9642
0x8ea09e c_parser_declaration_or_fndef
../../gcc-12-20210704/gcc/c/c-parser.c:2440
0x8f2983 c_parser_external_declaration
../../gcc-12-20210704/gcc/c/c-parser.c:1777
0x8f33c9 c_parser_translation_unit
../../gcc-12-20210704/gcc/c/c-parser.c:1650
0x8f33c9 c_parse_file()
../../gcc-12-20210704/gcc/c/c-parser.c:22121
0x952ead c_common_parse_file()
../../gcc-12-20210704/gcc/c-family/c-opts.c:1219
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210703
Copyright (C) 2021 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-sp11 test.c 
test.c:10:11: error: ‘x’ undeclared here (not in a function)
   10 | int b[x],
  |   ^
test.c:8:6: error: conflicting types for ‘fruit’; have ‘void(struct Apple, 
,  unsigned char)’
8 | void fruit(
  |  ^
test.c:12:1: note: an argument type that has a default promotion cannot match
an empty parameter name list declaration
   12 | {
  | ^
test.c:2:6: note: previous declaration of ‘fruit’ with type ‘void()’
2 | void fruit();
  |  ^
test.c: In function ‘fruit’:
test.c:13:10: warning: ‘return’ with a value, in function returning void
   13 |   return 0;
  |  ^
test.c:8:6: note: declared here
8 | void fruit(
  |  ^

[Bug c/101314] New: [12 Regression] ICE: in expand_call, at calls.c:4986

2021-07-04 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101314

Bug ID: 101314
   Summary: [12 Regression] ICE: in expand_call, at calls.c:4986
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c

struct A
{
  char x[0x];
};

extern void foo(struct A);

struct A a;

void main(void)
{
  foo(a);
}



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210627 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c: In function ‘main’:
test.c:13:3: sorry, unimplemented: passing too large argument on stack
   13 |   foo(a);
  |   ^~
during RTL pass: expand
test.c:13:3: internal compiler error: in expand_call, at calls.c:4986
0x6a0164 expand_call(tree_node*, rtx_def*, int)
../../gcc-12-20210627/gcc/calls.c:4986
0xafcb9e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-12-20210627/gcc/expr.c:11442
0x9d7b3b expand_expr
../../gcc-12-20210627/gcc/expr.h:301
0x9d7b3b expand_call_stmt
../../gcc-12-20210627/gcc/cfgexpand.c:2846
0x9d7b3b expand_gimple_stmt_1
../../gcc-12-20210627/gcc/cfgexpand.c:3877
0x9d7b3b expand_gimple_stmt
../../gcc-12-20210627/gcc/cfgexpand.c:4041
0x9dd8c3 expand_gimple_basic_block
../../gcc-12-20210627/gcc/cfgexpand.c:6083
0x9df677 execute
../../gcc-12-20210627/gcc/cfgexpand.c:6809
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 test.c 
test.c: In function ‘main’:
test.c:13:3: sorry, unimplemented: passing too large argument on stack
   13 |   foo(a);
  |   ^~
test.c:13: confused by earlier errors, bailing out

[Bug c/101313] New: [12 regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in count_type_elements, at expr.c:6273

2021-07-04 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101313

Bug ID: 101313
   Summary: [12 regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
count_type_elements, at expr.c:6273
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c

struct struct_A
{
  union bar
  {
enum test x;
  } var;
};

struct struct_B
{
  int x;
  struct struct_A a;
};


int foo()
{
  struct struct_A a = {0};
  struct struct_B b = {2, a};
}



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210627 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c:7:15: error: field ‘x’ has incomplete type
7 | enum test x;
  |   ^
test.c: In function ‘foo’:
test.c:21:19: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in count_type_elements, at expr.c:6273
   21 |   struct struct_B b = {2, a};
  |   ^
0x7a7886 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-12-20210627/gcc/tree.c:8734
0x6c0d82 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-12-20210627/gcc/tree.h:3496
0x6c0d82 count_type_elements
../../gcc-12-20210627/gcc/expr.c:6273
0xaed8c0 count_type_elements
../../gcc-12-20210627/gcc/expr.c:6245
0xaf0c09 categorize_ctor_elements_1
../../gcc-12-20210627/gcc/expr.c:6426
0xbc651b gimplify_init_constructor
../../gcc-12-20210627/gcc/gimplify.c:4932
0xbd710a gimplify_modify_expr
../../gcc-12-20210627/gcc/gimplify.c:5762
0xbbf26f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210627/gcc/gimplify.c:14210
0xbc2bf6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210627/gcc/gimplify.c:6869
0xbcc38d gimplify_and_add(tree_node*, gimple**)
../../gcc-12-20210627/gcc/gimplify.c:494
0xbcc38d gimplify_decl_expr
../../gcc-12-20210627/gcc/gimplify.c:1831
0xbbf566 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210627/gcc/gimplify.c:14407
0xbc2bf6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210627/gcc/gimplify.c:6869
0xbc01e3 gimplify_statement_list
../../gcc-12-20210627/gcc/gimplify.c:1887
0xbc01e3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210627/gcc/gimplify.c:14655
0xbc2bf6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210627/gcc/gimplify.c:6869
0xbc334d gimplify_bind_expr
../../gcc-12-20210627/gcc/gimplify.c:1426
0xbc0eae gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210627/gcc/gimplify.c:14411
0xbd8759 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210627/gcc/gimplify.c:6869
0xbd8759 gimplify_body(tree_node*, bool)
../../gcc-12-20210627/gcc/gimplify.c:15442
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 test.c 
test.c:7:15: error: field ‘x’ has incomplete type
7 | enum test x;
  |   ^
test.c:21: confused by earlier errors, bailing out

[Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830

2021-07-01 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285

Bug ID: 101285
   Summary: [12 Regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 5b.c 

extern char b[1];

void foo(void (*func)(void *), void * z);

static void bar(void * z) 
{
return z;
}

void baz()
{
foo( (void (*)(int (*a)[b++])) bar);
}



$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210627 (experimental)
Copyright (C) 2021 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-sp12 5b.c 
5b.c: In function ‘bar’:
5b.c:8:12: warning: ‘return’ with a value, in function returning void
8 | return z;
  |^
5b.c:6:13: note: declared here
6 | static void bar(void * z)
  | ^~~
5b.c: In function ‘baz’:
5b.c:13:30: error: lvalue required as increment operand
   13 | foo( (void (*)(int (*a)[b++])) bar);
  |  ^~
5b.c:13:5: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
   13 | foo( (void (*)(int (*a)[b++])) bar);
  | ^~~
0x7a7886 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-12-20210627/gcc/tree.c:8734
0x663d43 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-12-20210627/gcc/tree.h:3496
0x663d43 c_safe_arg_type_equiv_p
../../gcc-12-20210627/gcc/c/c-typeck.c:5830
0x8a8c75 c_safe_function_type_cast_p
../../gcc-12-20210627/gcc/c/c-typeck.c:5872
0x8a8c75 build_c_cast(unsigned int, tree_node*, tree_node*)
../../gcc-12-20210627/gcc/c/c-typeck.c:6079
0x8a9a34 c_cast_expr(unsigned int, c_type_name*, tree_node*)
../../gcc-12-20210627/gcc/c/c-typeck.c:6160
0x8cba45 c_parser_cast_expression
../../gcc-12-20210627/gcc/c/c-parser.c:8058
0x8cbbac c_parser_binary_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7869
0x8cce65 c_parser_conditional_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7592
0x8cd4a0 c_parser_expr_no_commas
../../gcc-12-20210627/gcc/c/c-parser.c:7507
0x8bf207 c_parser_expr_list
../../gcc-12-20210627/gcc/c/c-parser.c:10746
0x8ce66c c_parser_postfix_expression_after_primary
../../gcc-12-20210627/gcc/c/c-parser.c:10475
0x8c5d63 c_parser_postfix_expression
../../gcc-12-20210627/gcc/c/c-parser.c:10178
0x8ca16a c_parser_unary_expression
../../gcc-12-20210627/gcc/c/c-parser.c:8224
0x8cb939 c_parser_cast_expression
../../gcc-12-20210627/gcc/c/c-parser.c:8066
0x8cbbac c_parser_binary_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7869
0x8cce65 c_parser_conditional_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7592
0x8cd4a0 c_parser_expr_no_commas
../../gcc-12-20210627/gcc/c/c-parser.c:7507
0x8cd721 c_parser_expression
../../gcc-12-20210627/gcc/c/c-parser.c:10641
0x8cde98 c_parser_expression_conv
../../gcc-12-20210627/gcc/c/c-parser.c:10680
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 5b.c 
5b.c: In function ‘bar’:
5b.c:8:12: warning: ‘return’ with a value, in function returning void
8 | return z;
  |^
5b.c:6:13: note: declared here
6 | static void bar(void * z)
  | ^~~
5b.c: In function ‘baz’:
5b.c:13:30: error: lvalue required as increment operand
   13 | foo( (void (*)(int (*a)[b++])) bar);
  |  ^~
5b.c:13:5: error: too few arguments to function ‘foo’
   13 | foo( (void (*)(int (*a)[b++])) bar);
  | ^~~
5b.c:4:6: note: declared here
4 | void foo(void (*func)(void *), void * z);
  |  ^~~

[Bug c/101196] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p

2021-06-24 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101196

Bug ID: 101196
   Summary: [12 Regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
useless_type_conversion_p
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 37.c 

extern int var[16];

void foo(int [x]);

void bar(void)
{
  void foo(int array[]);
}

void baz(void)
{
  foo(var);
}

---

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210620 (experimental)
Copyright (C) 2021 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-sp12 37.c 
37.c:4:15: error: ‘x’ undeclared here (not in a function)
4 | void foo(int [x]);
  |   ^
37.c: In function ‘baz’:
37.c:13:7: error: type of formal parameter 1 is incomplete
   13 |   foo(var);
  |   ^~~
37.c:13:3: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
   13 |   foo(var);
  |   ^~~
0x7a313c tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-12-20210620/gcc/tree.c:8734
0x6d5d8a tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-12-20210620/gcc/tree.h:3494
0x6d5d8a useless_type_conversion_p(tree_node*, tree_node*)
../../gcc-12-20210620/gcc/gimple-expr.c:259
0xbc1108 types_compatible_p
../../gcc-12-20210620/gcc/gimple-expr.h:67
0xbc1108 gimplify_addr_expr
../../gcc-12-20210620/gcc/gimplify.c:6234
0xbb9384 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14141
0xbc4dc4 gimplify_call_expr
../../gcc-12-20210620/gcc/gimplify.c:3454
0xbbacd4 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14066
0xbbc9f6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:6865
0xbbd14d gimplify_bind_expr
../../gcc-12-20210620/gcc/gimplify.c:1426
0xbbacee gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14295
0xbd2229 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:6865
0xbd2229 gimplify_body(tree_node*, bool)
../../gcc-12-20210620/gcc/gimplify.c:15339
0xbd266d gimplify_function_tree(tree_node*)
../../gcc-12-20210620/gcc/gimplify.c:15493
0xa10bf7 cgraph_node::analyze()
../../gcc-12-20210620/gcc/cgraphunit.c:670
0xa135f7 analyze_functions
../../gcc-12-20210620/gcc/cgraphunit.c:1234
0xa1428d symbol_table::finalize_compilation_unit()
../../gcc-12-20210620/gcc/cgraphunit.c:2508
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 37.c 
37.c:4:15: error: ‘x’ undeclared here (not in a function)
4 | void foo(int [x]);
  |   ^
37.c: In function ‘baz’:
37.c:13:7: error: type of formal parameter 1 is incomplete
   13 |   foo(var);
  |   ^~~

[Bug c/101171] [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_expr_sizeof_expr, at c/c-typeck.c:3006

2021-06-23 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101171

--- Comment #3 from John X  ---
(In reply to Richard Biener from comment #1)
> Is your GCC 11 compiler checking-enabled?  I doubt it is a regression.

gcc 11 build command:
```
configure --prefix=install_path --enable-languages=c --disable-multilib
```

Platform: Ubuntu 20.04 x64

[Bug c/101172] New: [12 regression] ICE Segmentation fault

2021-06-22 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172

Bug ID: 101172
   Summary: [12 regression] ICE Segmentation fault
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 36.c 

union U
{
  int a[3];
  struct
  {
int a : 3;
struct this_struct var;
  } b;
};

const union U hello = {.a = {1, 2, 3}};


void foo()
{
  int x = hello.b.a;
}

---

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210620 (experimental)
Copyright (C) 2021 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-sp12 36.c 
36.c:8:24: error: field ‘var’ has incomplete type
8 | struct this_struct var;
  |^~~
36.c: In function ‘foo’:
36.c:17:18: internal compiler error: Segmentation fault
   17 |   int x = hello.b.a;
  |   ~~~^~
0xe600af crash_signal
../../gcc-12-20210620/gcc/toplev.c:327
0xb85ab1 fold_const_aggregate_ref_1(tree_node*, tree_node* (*)(tree_node*))
../../gcc-12-20210620/gcc/gimple-fold.c:8184
0xb86e49 fold_const_aggregate_ref(tree_node*)
../../gcc-12-20210620/gcc/gimple-fold.c:8250
0xb86e49 maybe_fold_reference
../../gcc-12-20210620/gcc/gimple-fold.c:333
0xb8bc86 fold_gimple_assign
../../gcc-12-20210620/gcc/gimple-fold.c:483
0xb8bc86 fold_stmt_1
../../gcc-12-20210620/gcc/gimple-fold.c:6250
0xbd1071 gimplify_modify_expr
../../gcc-12-20210620/gcc/gimplify.c:5982
0xbb909f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14094
0xbbc9f6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:6865
0xbbe8d6 gimplify_and_add(tree_node*, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:494
0xbbe8d6 internal_get_tmp_var
../../gcc-12-20210620/gcc/gimplify.c:647
0xbb887e get_formal_tmp_var(tree_node*, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:668
0xbb887e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:15083
0xbb9363 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14399
0xbd0dff gimplify_modify_expr
../../gcc-12-20210620/gcc/gimplify.c:5806
0xbb909f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14094
0xbbc9f6 gimplify_stmt(tree_node**, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:6865
0xbc3c9d gimplify_and_add(tree_node*, gimple**)
../../gcc-12-20210620/gcc/gimplify.c:494
0xbc3c9d gimplify_decl_expr
../../gcc-12-20210620/gcc/gimplify.c:1831
0xbb939a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-12-20210620/gcc/gimplify.c:14291
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 36.c 
36.c:8:24: error: field ‘var’ has incomplete type
8 | struct this_struct var;
  |^~~
36.c:17: confused by earlier errors, bailing out

[Bug c/101171] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_expr_sizeof_expr, at c/c-typeck.c:3006

2021-06-22 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101171

Bug ID: 101171
   Summary: [12 Regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
c_expr_sizeof_expr, at c/c-typeck.c:3006
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 34.c 

extern void foo(void);
int x = 0x1234;

int bar()
{
  if (x !=  ( sizeof( (enum t) 0x1234) ) )
foo();
}

---

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210620 (experimental)
Copyright (C) 2021 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-sp12 34.c 
34.c: In function ‘bar’:
34.c:7:29: error: conversion to incomplete type
7 |   if (x !=  ( sizeof( (enum t) 0x1234) ) )
  | ^
34.c:7:29: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_expr_sizeof_expr, at c/c-typeck.c:3006
0x7a313c tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-12-20210620/gcc/tree.c:8734
0x65d005 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-12-20210620/gcc/tree.h:3494
0x65d005 c_expr_sizeof_expr(unsigned int, c_expr)
../../gcc-12-20210620/gcc/c/c-typeck.c:3006
0x8c573e c_parser_sizeof_expression
../../gcc-12-20210620/gcc/c/c-parser.c:8299
0x8c573e c_parser_unary_expression
../../gcc-12-20210620/gcc/c/c-parser.c:8196
0x8c6309 c_parser_cast_expression
../../gcc-12-20210620/gcc/c/c-parser.c:8066
0x8c657c c_parser_binary_expression
../../gcc-12-20210620/gcc/c/c-parser.c:7869
0x8c7835 c_parser_conditional_expression
../../gcc-12-20210620/gcc/c/c-parser.c:7592
0x8c7e70 c_parser_expr_no_commas
../../gcc-12-20210620/gcc/c/c-parser.c:7507
0x8c80f1 c_parser_expression
../../gcc-12-20210620/gcc/c/c-parser.c:10638
0x8c0853 c_parser_postfix_expression
../../gcc-12-20210620/gcc/c/c-parser.c:9086
0x8c4b4a c_parser_unary_expression
../../gcc-12-20210620/gcc/c/c-parser.c:8224
0x8c6309 c_parser_cast_expression
../../gcc-12-20210620/gcc/c/c-parser.c:8066
0x8c66f4 c_parser_binary_expression
../../gcc-12-20210620/gcc/c/c-parser.c:7992
0x8c7835 c_parser_conditional_expression
../../gcc-12-20210620/gcc/c/c-parser.c:7592
0x8c7e70 c_parser_expr_no_commas
../../gcc-12-20210620/gcc/c/c-parser.c:7507
0x8c80f1 c_parser_expression
../../gcc-12-20210620/gcc/c/c-parser.c:10638
0x8c9655 c_parser_expression_conv
../../gcc-12-20210620/gcc/c/c-parser.c:10677
0x8c9655 c_parser_condition
../../gcc-12-20210620/gcc/c/c-parser.c:6277
0x8c973b c_parser_paren_condition
../../gcc-12-20210620/gcc/c/c-parser.c:6297
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 34.c 
34.c: In function ‘bar’:
34.c:7:29: error: conversion to incomplete type
7 |   if (x !=  ( sizeof( (enum t) 0x1234) ) )
  | ^

[Bug c/98198] New: [11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in decl_or_type_attrs

2020-12-08 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98198

Bug ID: 98198
   Summary: [11 Regression] internal compiler error: tree check:
expected class ‘type’, have ‘exceptional’ (error_mark)
in decl_or_type_attrs
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test-6951.c 

static inline void sub_1 ( ) { 
struct struct_1 var_9 , var_10
}

static int var_9[1] __attribute__ ( ( section ( ".data" ) ) ) ; 



$ gcc-11 --version
gcc (GCC) 11.0.0 20201129 (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.



$ gcc-11 test-6951.c 
test-6951.c: In function ‘sub_1’:
test-6951.c:3:25: error: storage size of ‘var_9’ isn’t known
3 | struct struct_1 var_9 , var_10
  | ^
test-6951.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘}’ token
4 | }
  | ^
test-6951.c:6:1: internal compiler error: tree check: expected class ‘type’,
have ‘exceptional’ (error_mark) in decl_or_type_attrs, at
c-family/c-attribs.c:775
6 | static int var_9[1] __attribute__ ( ( section ( ".data" ) ) ) ;
  | ^~
0x753c11 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-11-20201129/gcc/tree.c:9860
0x642f30 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-11-20201129/gcc/tree.h:3454
0x642f30 decl_or_type_attrs
../../gcc-11-20201129/gcc/c-family/c-attribs.c:775
0x642f30 validate_attr_args
../../gcc-11-20201129/gcc/c-family/c-attribs.c:803
0x90691d validate_attr_arg
../../gcc-11-20201129/gcc/c-family/c-attribs.c:889
0x90691d handle_section_attribute
../../gcc-11-20201129/gcc/c-family/c-attribs.c:2132
0x80d0dc decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc-11-20201129/gcc/attribs.c:723
0x8295f2 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, unsigned
int*)
../../gcc-11-20201129/gcc/c/c-decl.c:5188
0x884e32 c_parser_declaration_or_fndef
../../gcc-11-20201129/gcc/c/c-parser.c:2302
0x867ef0 c_parser_compound_statement_nostart
../../gcc-11-20201129/gcc/c/c-parser.c:5700
0x8848f5 c_parser_compound_statement
../../gcc-11-20201129/gcc/c/c-parser.c:5597
0x886378 c_parser_declaration_or_fndef
../../gcc-11-20201129/gcc/c/c-parser.c:2539
0x88dbe3 c_parser_external_declaration
../../gcc-11-20201129/gcc/c/c-parser.c:1777
0x88e629 c_parser_translation_unit
../../gcc-11-20201129/gcc/c/c-parser.c:1650
0x88e629 c_parse_file()
../../gcc-11-20201129/gcc/c/c-parser.c:21877
0x8ebdfd c_common_parse_file()
../../gcc-11-20201129/gcc/c-family/c-opts.c:1198
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-10 --version
gcc (GCC) 10.2.1 20201128
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.



$ gcc-10 test-6951.c 
test-6951.c: In function ‘sub_1’:
test-6951.c:3:18: error: storage size of ‘var_9’ isn’t known
3 |  struct struct_1 var_9 , var_10
  |  ^
test-6951.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘}’ token
4 | }
  | ^
test-6951.c:6:1: error: expected declaration or statement at end of input
6 | static int var_9[1] __attribute__ ( ( section ( ".data" ) ) ) ;
  | ^~

[Bug c/98197] New: [11 Regresson] internal compiler error: Floating point exception

2020-12-08 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98197

Bug ID: 98197
   Summary: [11 Regresson] internal compiler error: Floating point
exception
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

struct struct_0 { char field_0 ; } ; 

struct struct_0 { struct struct_0 field_1 ; } x[1]; 

int foo ( ) { 
__builtin_clear_padding ( & x ) ; 
}



$ gcc-11 --version
gcc (GCC) 11.0.0 20201129 (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.



$ gcc-11 test.c 
test.c:4:8: error: redefinition of ‘struct struct_0’
4 | struct struct_0 { struct struct_0 field_1 ; } x[1];
  |^~~~
test.c:2:8: note: originally defined here
2 | struct struct_0 { char field_0 ; } ;
  |^~~~
test.c:4:35: error: field ‘field_1’ has incomplete type
4 | struct struct_0 { struct struct_0 field_1 ; } x[1];
  |   ^~~
during GIMPLE pass: lower
test.c: In function ‘foo’:
test.c:6:5: internal compiler error: Floating point exception
6 | int foo ( ) {
  | ^~~
0xdeeb4f crash_signal
../../gcc-11-20201129/gcc/toplev.c:330
0xb13bce clear_padding_type
../../gcc-11-20201129/gcc/gimple-fold.c:4555
0xb14953 gimple_fold_builtin_clear_padding
../../gcc-11-20201129/gcc/gimple-fold.c:4723
0xb23770 gimple_fold_builtin
../../gcc-11-20201129/gcc/gimple-fold.c:4897
0xb23770 gimple_fold_call
../../gcc-11-20201129/gcc/gimple-fold.c:5328
0xb23ffb fold_stmt_1
../../gcc-11-20201129/gcc/gimple-fold.c:6029
0x17b0c3f lower_stmt
../../gcc-11-20201129/gcc/gimple-low.c:388
0x17b05e2 lower_sequence
../../gcc-11-20201129/gcc/gimple-low.c:217
0x17b05e2 lower_gimple_bind
../../gcc-11-20201129/gcc/gimple-low.c:473
0x17b1759 lower_function_body
../../gcc-11-20201129/gcc/gimple-low.c:110
0x17b1759 execute
../../gcc-11-20201129/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.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-10 --version
gcc (GCC) 10.2.1 20201128
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.



$ gcc-10 test.c 
test.c:4:8: error: redefinition of ‘struct struct_0’
4 | struct struct_0 { struct struct_0 field_1 ; } x[1];
  |^~~~
test.c:2:8: note: originally defined here
2 | struct struct_0 { char field_0 ; } ;
  |^~~~
test.c:4:35: error: field ‘field_1’ has incomplete type
4 | struct struct_0 { struct struct_0 field_1 ; } x[1];
  |   ^~~
test.c: In function ‘foo’:
test.c:7:2: warning: implicit declaration of function
‘__builtin_clear_padding’; did you mean ‘__builtin_nearbyint’?
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration]8;;]
7 |  __builtin_clear_padding ( & x ) ;
  |  ^~~
  |  __builtin_nearbyint

[Bug c/98195] New: [11 Regression] internal compiler error: Segmentation fault

2020-12-08 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98195

Bug ID: 98195
   Summary: [11 Regression] internal compiler error: Segmentation
fault
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

static _Atomic long double x ; 

void foo ( void ) { 

int a , b , c ; 

x += foo ( x , a , b , c ) ; 

}



$ gcc-11 --version
gcc (GCC) 11.0.0 20201129 (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.



$ gcc-11 test.c 
test.c: In function ‘foo’:
test.c:8:14: error: too many arguments to function ‘foo’
8 | x += foo ( x , a , b , c ) ;
  |  ^~~
test.c:4:6: note: declared here
4 | void foo ( void ) {
  |  ^~~
test.c:8:9: error: void value not ignored as it ought to be
8 | x += foo ( x , a , b , c ) ;
  | ^
test.c:8:11: internal compiler error: Segmentation fault
8 | x += foo ( x , a , b , c ) ;
  |   ^~
0xdeeb4f crash_signal
../../gcc-11-20201129/gcc/toplev.c:330
0xb5c982 gimplify_target_expr
../../gcc-11-20201129/gcc/gimplify.c:6757
0xb51e2e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20201129/gcc/gimplify.c:14406
0xb55396 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20201129/gcc/gimplify.c:6862
0xb52f0b gimplify_statement_list
../../gcc-11-20201129/gcc/gimplify.c:1869
0xb52f0b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20201129/gcc/gimplify.c:14454
0xb67dd7 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20201129/gcc/gimplify.c:6862
0xb67dd7 gimplify_compound_expr
../../gcc-11-20201129/gcc/gimplify.c:6062
0xb52141 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20201129/gcc/gimplify.c:14000
0xb55396 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20201129/gcc/gimplify.c:6862
0xb52f0b gimplify_statement_list
../../gcc-11-20201129/gcc/gimplify.c:1869
0xb52f0b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20201129/gcc/gimplify.c:14454
0xb55396 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20201129/gcc/gimplify.c:6862
0xb5605d gimplify_bind_expr
../../gcc-11-20201129/gcc/gimplify.c:1417
0xb52121 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20201129/gcc/gimplify.c:14211
0xb6af39 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20201129/gcc/gimplify.c:6862
0xb6af39 gimplify_body(tree_node*, bool)
../../gcc-11-20201129/gcc/gimplify.c:15246
0xb6b35d gimplify_function_tree(tree_node*)
../../gcc-11-20201129/gcc/gimplify.c:15400
0x9af937 cgraph_node::analyze()
../../gcc-11-20201129/gcc/cgraphunit.c:670
0x9b2417 analyze_functions
../../gcc-11-20201129/gcc/cgraphunit.c:1235
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-10 --version
gcc (GCC) 10.2.1 20201128
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.



$ gcc-10 test.c 
test.c: In function ‘foo’:
test.c:8:7: error: too many arguments to function ‘foo’
8 |  x += foo ( x , a , b , c ) ;
  |   ^~~
test.c:4:6: note: declared here
4 | void foo ( void ) {
  |  ^~~
test.c:8:2: error: void value not ignored as it ought to be
8 |  x += foo ( x , a , b , c ) ;
  |  ^
test.c:8: confused by earlier errors, bailing out

[Bug c/98194] New: [9/10/11 Regression]internal compiler error: output_operand: invalid use of register 'frame'

2020-12-08 Thread anbu1024.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98194

Bug ID: 98194
   Summary: [9/10/11 Regression]internal compiler error:
output_operand: invalid use of register 'frame'
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void sub_0 ( void ) 
{ 
register int var_0 asm ( "19" ) ; 
if ( var_0 != - 1 ) 
sub_0 ( ) ; 
}



$ gcc-11 --version
gcc (GCC) 11.0.0 20201129 (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.



$ gcc-11 test.c 
during RTL pass: final
test.c: In function ‘sub_0’:
test.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
7 | }
  | ^
0xaa7706 output_operand_lossage(char const*, ...)
../../gcc-11-20201129/gcc/final.c:3627
0xaa7a41 output_operand(rtx_def*, int)
../../gcc-11-20201129/gcc/final.c:4069
0xaa85bd output_asm_insn(char const*, rtx_def**)
../../gcc-11-20201129/gcc/final.c:3981
0xaabf19 final_scan_insn_1
../../gcc-11-20201129/gcc/final.c:3124
0xaac35b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-11-20201129/gcc/final.c:3170
0xaac456 final_1
../../gcc-11-20201129/gcc/final.c:2021
0xaad004 rest_of_handle_final
../../gcc-11-20201129/gcc/final.c:4676
0xaad004 execute
../../gcc-11-20201129/gcc/final.c:4754
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-10 test.c 
during RTL pass: final
test.c: In function ‘sub_0’:
test.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
7 | }
  | ^
0x8445b6 output_operand_lossage(char const*, ...)
../../gcc-10-20201128/gcc/final.c:3609
0x8448e1 output_operand(rtx_def*, int)
../../gcc-10-20201128/gcc/final.c:4051
0x84541d output_asm_insn(char const*, rtx_def**)
../../gcc-10-20201128/gcc/final.c:3963
0x848ad9 final_scan_insn_1
../../gcc-10-20201128/gcc/final.c:3106
0x848d8b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-10-20201128/gcc/final.c:3152
0x849074 final_1
../../gcc-10-20201128/gcc/final.c:2020
0x849804 rest_of_handle_final
../../gcc-10-20201128/gcc/final.c:4658
0x849804 execute
../../gcc-10-20201128/gcc/final.c:4736
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-10 --version
gcc (GCC) 10.2.1 20201128
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.



$ gcc-9 test.c 
during RTL pass: final
test.c: In function ‘sub_0’:
test.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
7 | }
  | ^
0x7f5806 output_operand_lossage(char const*, ...)
../../gcc-9-20201127/gcc/final.c:3610
0xd67504 ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc-9-20201127/gcc/config/i386/i386.c:18398
0x7f5b31 output_operand(rtx_def*, int)
../../gcc-9-20201127/gcc/final.c:4052
0x7f665c output_asm_insn(char const*, rtx_def**)
../../gcc-9-20201127/gcc/final.c:3964
0x7f7d22 final_scan_insn_1
../../gcc-9-20201127/gcc/final.c:3107
0x7f7f7b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-9-20201127/gcc/final.c:3153
0x7f8254 final_1
../../gcc-9-20201127/gcc/final.c:2021
0x7f8c44 rest_of_handle_final
../../gcc-9-20201127/gcc/final.c:4659
0x7f8c44 execute
../../gcc-9-20201127/gcc/final.c:4737
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.3.1 20201127
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying condi

[Bug c/96610] New: [11 Regression] ICE: in gimplify_va_arg_expr, at gimplify.c:15150

2020-08-13 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96610

Bug ID: 96610
   Summary: [11 Regression] ICE: in gimplify_va_arg_expr, at
gimplify.c:15150
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void foo ( ) 
{
int x ; 

int y[] = 1; 

__builtin_va_arg ( x, int z );
}

---

$ gcc-snapshot11 --version
gcc (GCC) 11.0.0 20200802 (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.

---

$ gcc-snapshot11 test.c 
test.c: In function ‘foo’:
test.c:6:15: error: invalid initializer
6 | int y[] = 1;
  |   ^
test.c:8:30: error: expected ‘)’ before ‘z’
8 | __builtin_va_arg ( x, int z );
  |  ^~
  |  )
test.c:8:27: error: first argument to ‘va_arg’ not of type ‘va_list’
8 | __builtin_va_arg ( x, int z );
  |   ^~~
test.c:8:27: internal compiler error: in gimplify_va_arg_expr, at
gimplify.c:15150
8 | __builtin_va_arg ( x, int z );
  | ~~^
0x67c083 gimplify_va_arg_expr(tree_node**, gimple**, gimple**)
../../gcc-11-20200802/gcc/gimplify.c:15150
0xb12522 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200802/gcc/gimplify.c:13712
0xb15076 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20200802/gcc/gimplify.c:6822
0xb130eb gimplify_statement_list
../../gcc-11-20200802/gcc/gimplify.c:1856
0xb130eb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200802/gcc/gimplify.c:14082
0xb15076 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20200802/gcc/gimplify.c:6822
0xb15d41 gimplify_bind_expr
../../gcc-11-20200802/gcc/gimplify.c:1411
0xb1267d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200802/gcc/gimplify.c:13839
0xb2a797 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20200802/gcc/gimplify.c:6822
0xb2a797 gimplify_body(tree_node*, bool)
../../gcc-11-20200802/gcc/gimplify.c:14874
0xb2abcd gimplify_function_tree(tree_node*)
../../gcc-11-20200802/gcc/gimplify.c:15028
0x974437 cgraph_node::analyze()
../../gcc-11-20200802/gcc/cgraphunit.c:671
0x977477 analyze_functions
../../gcc-11-20200802/gcc/cgraphunit.c:1231
0x97803d symbol_table::finalize_compilation_unit()
../../gcc-11-20200802/gcc/cgraphunit.c:2987
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-snapshot10 --version
gcc (GCC) 10.2.1 20200725
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.

---

$ gcc-snapshot10 test.c 
test.c: In function ‘foo’:
test.c:6:15: error: invalid initializer
6 | int y[] = 1;
  |   ^
test.c:8:30: error: expected ‘)’ before ‘z’
8 | __builtin_va_arg ( x, int z );
  |  ^~
  |  )
test.c:8:27: error: first argument to ‘va_arg’ not of type ‘va_list’
8 | __builtin_va_arg ( x, int z );
  |   ^~~
test.c:8: confused by earlier errors, bailing out

[Bug c/96596] New: [11 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in match_builtin_function_types

2020-08-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96596

Bug ID: 96596
   Summary: [11 Regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
match_builtin_function_types
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void __builtin_abort ( int x [__builtin_vis_fpcmpeq8shl ]) ; 

---

$ gcc-snapshot11 --version
gcc (GCC) 11.0.0 20200802 (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.

---

$ gcc-snapshot11 test.c 
test.c:2:31: error: ‘__builtin_vis_fpcmpeq8shl’ undeclared here (not in a
function); did you mean ‘__builtin_ia32_cmpeqps’?
2 | void __builtin_abort ( int x [__builtin_vis_fpcmpeq8shl ]) ;
  |   ^
  |   __builtin_ia32_cmpeqps
test.c:2:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in match_builtin_function_types, at c/c-decl.c:1715
2 | void __builtin_abort ( int x [__builtin_vis_fpcmpeq8shl ]) ;
  | ^~~~
0x73c1e2 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-11-20200802/gcc/tree.c:9737
0x5f3a13 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-11-20200802/gcc/tree.h:3426
0x5f3a13 match_builtin_function_types
../../gcc-11-20200802/gcc/c/c-decl.c:1715
0x5f3a13 diagnose_mismatched_decls
../../gcc-11-20200802/gcc/c/c-decl.c:1994
0x7ed0e4 duplicate_decls
../../gcc-11-20200802/gcc/c/c-decl.c:2936
0x7efab9 pushdecl(tree_node*)
../../gcc-11-20200802/gcc/c/c-decl.c:3129
0x80226e start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
../../gcc-11-20200802/gcc/c/c-decl.c:5201
0x85 c_parser_declaration_or_fndef
../../gcc-11-20200802/gcc/c/c-parser.c:2299
0x866893 c_parser_external_declaration
../../gcc-11-20200802/gcc/c/c-parser.c:1773
0x867389 c_parser_translation_unit
../../gcc-11-20200802/gcc/c/c-parser.c:1646
0x867389 c_parse_file()
../../gcc-11-20200802/gcc/c/c-parser.c:21812
0x8c020d c_common_parse_file()
../../gcc-11-20200802/gcc/c-family/c-opts.c:1188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-snapshot10 --version 
gcc (GCC) 10.2.1 20200725
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.

---

$ gcc-snapshot10 test.c 
test.c:2:31: error: ‘__builtin_vis_fpcmpeq8shl’ undeclared here (not in a
function); did you mean ‘__builtin_ia32_cmpeqps’?
2 | void __builtin_abort ( int x [__builtin_vis_fpcmpeq8shl ]) ;
  |   ^
  |   __builtin_ia32_cmpeqps
test.c:2:6: warning: conflicting types for built-in function ‘__builtin_abort’;
expected ‘void(void)’
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wbuiltin-declaration-mismatch-Wbuiltin-declaration-mismatch]8;;]
2 | void __builtin_abort ( int x [__builtin_vis_fpcmpeq8shl ]) ;
  |  ^~~
test.c:1:1: note: ‘__builtin_abort’ is declared in header ‘’
  +++ |+#include 
1 |

[Bug c/96546] New: [10/11] internal compiler error: in default_conversion

2020-08-09 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96546

Bug ID: 96546
   Summary: [10/11] internal compiler error: in default_conversion
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void foo () {} 

__attribute__ ( ( constructor ( foo ) ) ) void bar () { return 0 ; }

---

$ gcc-snapshot11 --version
gcc (GCC) 11.0.0 20200802 (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.

---

$ gcc-snapshot11 test.c 
test.c:4:1: internal compiler error: in default_conversion, at
c/c-typeck.c:2185
4 | __attribute__ ( ( constructor ( foo ) ) ) void bar () { return 0 ; }
  | ^
0x5fcc39 default_conversion(tree_node*)
../../gcc-11-20200802/gcc/c/c-typeck.c:2185
0x8d7896 get_priority
../../gcc-11-20200802/gcc/c-family/c-attribs.c:1571
0x8d7ace handle_constructor_attribute
../../gcc-11-20200802/gcc/c-family/c-attribs.c:1622
0x7e61e7 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc-11-20200802/gcc/attribs.c:714
0x802a35 start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc-11-20200802/gcc/c/c-decl.c:9184
0x85d226 c_parser_declaration_or_fndef
../../gcc-11-20200802/gcc/c/c-parser.c:2434
0x866893 c_parser_external_declaration
../../gcc-11-20200802/gcc/c/c-parser.c:1773
0x867389 c_parser_translation_unit
../../gcc-11-20200802/gcc/c/c-parser.c:1646
0x867389 c_parse_file()
../../gcc-11-20200802/gcc/c/c-parser.c:21812
0x8c020d c_common_parse_file()
../../gcc-11-20200802/gcc/c-family/c-opts.c:1188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-snapshot10 --version
gcc (GCC) 10.2.1 20200725
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.

---

$ gcc-snapshot10 test.c 
test.c:4:1: internal compiler error: in default_conversion, at
c/c-typeck.c:2182
4 | __attribute__ ( ( constructor ( foo ) ) ) void bar () { return 0 ; }
  | ^
0x59e720 default_conversion(tree_node*)
../../gcc-10-20200725/gcc/c/c-typeck.c:2182
0x6a61ac get_priority
../../gcc-10-20200725/gcc/c-family/c-attribs.c:1571
0x6a7d1f handle_constructor_attribute
../../gcc-10-20200725/gcc/c-family/c-attribs.c:1622
0x5e26e5 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc-10-20200725/gcc/attribs.c:714
0x5f94e0 start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc-10-20200725/gcc/c/c-decl.c:9153
0x641be2 c_parser_declaration_or_fndef
../../gcc-10-20200725/gcc/c/c-parser.c:2406
0x649723 c_parser_external_declaration
../../gcc-10-20200725/gcc/c/c-parser.c:1745
0x64a221 c_parser_translation_unit
../../gcc-10-20200725/gcc/c/c-parser.c:1618
0x64a221 c_parse_file()
../../gcc-10-20200725/gcc/c/c-parser.c:21745
0x69440b c_common_parse_file()
../../gcc-10-20200725/gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c/96545] New: [10/11] internal compiler error: Segmentation fault

2020-08-09 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96545

Bug ID: 96545
   Summary: [10/11] internal compiler error: Segmentation fault
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c

extern char x[]; 
extern char y[];
extern char z[];

void foo ()
{
__atomic_exchange ( & x , & y , & z , & z ) ;
}

---

$ gcc-snapshot11 --version
gcc (GCC) 11.0.0 20200802 (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.

---

$ gcc-snapshot11 test.c 
test.c: In function ‘foo’:
test.c:8:5: internal compiler error: Segmentation fault
8 | __atomic_exchange ( & x , & y , & z , & z ) ;
  | ^
0xdd207f crash_signal
../../gcc-11-20200802/gcc/toplev.c:328
0x871826 get_atomic_generic_size
../../gcc-11-20200802/gcc/c-family/c-common.c:7021
0x8a164d resolve_overloaded_atomic_exchange
../../gcc-11-20200802/gcc/c-family/c-common.c:7219
0x8a164d resolve_overloaded_builtin(unsigned int, tree_node*, vec*)
../../gcc-11-20200802/gcc/c-family/c-common.c:7564
0x82a674 c_build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*)
../../gcc-11-20200802/gcc/c/c-typeck.c:3202
0x848c1c c_parser_postfix_expression_after_primary
../../gcc-11-20200802/gcc/c/c-parser.c:10536
0x840901 c_parser_postfix_expression
../../gcc-11-20200802/gcc/c/c-parser.c:10209
0x8449fa c_parser_unary_expression
../../gcc-11-20200802/gcc/c/c-parser.c:8306
0x84620d c_parser_cast_expression
../../gcc-11-20200802/gcc/c/c-parser.c:8148
0x846499 c_parser_binary_expression
../../gcc-11-20200802/gcc/c/c-parser.c:7951
0x847475 c_parser_conditional_expression
../../gcc-11-20200802/gcc/c/c-parser.c:7685
0x847ab0 c_parser_expr_no_commas
../../gcc-11-20200802/gcc/c/c-parser.c:7600
0x847d21 c_parser_expression
../../gcc-11-20200802/gcc/c/c-parser.c:10672
0x8484c7 c_parser_expression_conv
../../gcc-11-20200802/gcc/c/c-parser.c:10705
0x83de7b c_parser_statement_after_labels
../../gcc-11-20200802/gcc/c/c-parser.c:6329
0x8400d1 c_parser_compound_statement_nostart
../../gcc-11-20200802/gcc/c/c-parser.c:5833
0x85c7b4 c_parser_compound_statement
../../gcc-11-20200802/gcc/c/c-parser.c:5645
0x85e20b c_parser_declaration_or_fndef
../../gcc-11-20200802/gcc/c/c-parser.c:2533
0x866893 c_parser_external_declaration
../../gcc-11-20200802/gcc/c/c-parser.c:1773
0x867389 c_parser_translation_unit
../../gcc-11-20200802/gcc/c/c-parser.c:1646
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

---

$ gcc-snapshot10 --version
gcc (GCC) 10.2.1 20200725
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.

---

$ gcc-snapshot10 test.c 
test.c: In function ‘foo’:
test.c:8:5: internal compiler error: Segmentation fault
8 | __atomic_exchange ( & x , & y , & z , & z ) ;
  | ^
0xaecd9f crash_signal
../../gcc-10-20200725/gcc/toplev.c:328
0x65199b get_atomic_generic_size
../../gcc-10-20200725/gcc/c-family/c-common.c:6952
0x67d277 resolve_overloaded_atomic_exchange
../../gcc-10-20200725/gcc/c-family/c-common.c:7117
0x67d277 resolve_overloaded_builtin(unsigned int, tree_node*, vec*)
../../gcc-10-20200725/gcc/c-family/c-common.c:7462
0x615203 c_build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*)
../../gcc-10-20200725/gcc/c/c-typeck.c:3199
0x62f5de c_parser_postfix_expression_after_primary
../../gcc-10-20200725/gcc/c/c-parser.c:10501
0x627eb1 c_parser_postfix_expression
../../gcc-10-20200725/gcc/c/c-parser.c:10176
0x62b77a c_parser_unary_expression
../../gcc-10-20200725/gcc/c/c-parser.c:8273
0x62cefd c_parser_cast_expression
../../gcc-10-20200725/gcc/c/c-parser.c:8115
0x62d18e c_parser_binary_expression
../../gcc-10-20200725/gcc/c/c-parser.c:7918
0x62e0c5 c_parser_conditional_expression
../../gcc-10-20200725/gcc/c/c-parser.c:7652
0x62e5f0 c_parse

[Bug c/95161] New: [10/11 Regression] internal compiler error: in gimplify_expr, at gimplify.c:14609

2020-05-16 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95161

Bug ID: 95161
   Summary: [10/11 Regression] internal compiler error: in
gimplify_expr, at gimplify.c:14609
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

unsigned short * x = 0 ; 

int foo ( void ) { * x = 0 ; } 

int x [ ] = { 1 , 2 , 3 }


$ gcc-11 --version
gcc (GCC) 11.0.0 20200510 (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.


$ gcc-11 test.c 
test.c:6:5: error: conflicting types for ‘x’
6 | int x [ ] = { 1 , 2 , 3 }
  | ^
test.c:2:18: note: previous definition of ‘x’ was here
2 | unsigned short * x = 0 ;
  |  ^
test.c:6:1: error: expected ‘,’ or ‘;’ at end of input
6 | int x [ ] = { 1 , 2 , 3 }
  | ^~~
test.c: In function ‘foo’:
test.c:4:20: internal compiler error: in gimplify_expr, at gimplify.c:14609
4 | int foo ( void ) { * x = 0 ; }
  |^~~
0x674c01 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200510/gcc/gimplify.c:14609
0xb0192a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200510/gcc/gimplify.c:13706
0xb1669f gimplify_modify_expr
../../gcc-11-20200510/gcc/gimplify.c:5759
0xaff80c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200510/gcc/gimplify.c:13585
0xb02e76 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20200510/gcc/gimplify.c:6802
0xb03b43 gimplify_bind_expr
../../gcc-11-20200510/gcc/gimplify.c:1411
0xb00383 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-11-20200510/gcc/gimplify.c:13786
0xb17a87 gimplify_stmt(tree_node**, gimple**)
../../gcc-11-20200510/gcc/gimplify.c:6802
0xb17a87 gimplify_body(tree_node*, bool)
../../gcc-11-20200510/gcc/gimplify.c:14834
0xb17ebd gimplify_function_tree(tree_node*)
../../gcc-11-20200510/gcc/gimplify.c:14988
0x962f47 cgraph_node::analyze()
../../gcc-11-20200510/gcc/cgraphunit.c:670
0x965b47 analyze_functions
../../gcc-11-20200510/gcc/cgraphunit.c:1227
0x966712 symbol_table::finalize_compilation_unit()
../../gcc-11-20200510/gcc/cgraphunit.c:2971
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.


$ gcc-10 test.c 
test.c:6:5: error: conflicting types for ‘x’
6 | int x [ ] = { 1 , 2 , 3 }
  | ^
test.c:2:18: note: previous definition of ‘x’ was here
2 | unsigned short * x = 0 ;
  |  ^
test.c:6:1: error: expected ‘,’ or ‘;’ at end of input
6 | int x [ ] = { 1 , 2 , 3 }
  | ^~~
test.c: In function ‘foo’:
test.c:4:20: internal compiler error: in gimplify_expr, at gimplify.c:14632
4 | int foo ( void ) { * x = 0 ; }
  |^~~
0x674570 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:14632
0xaff66a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13729
0xb1453f gimplify_modify_expr
../../gcc-10-20200419/gcc/gimplify.c:5782
0xafd53c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13608
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb0199b gimplify_bind_expr
../../gcc-10-20200419/gcc/gimplify.c:1424
0xafe0b3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13809
0xb15927 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb15927 gimplify_body(tree_node*, bool)
../../gcc-10-20200419/gcc/gimplify.c:14857
0xb15e53 gimplify_function_tree(tree_node*)
../../gcc-10-20200419/gcc/gimplify.c:15030
0x9607d7 cgraph_node::analyze()
../../gcc-10-20200419/gcc/cgraphunit.c:670
0x9633f7 analyze_functions
../../gcc-10-20200419/gcc/cgraphunit.c:1227
0x963fc2 symbol_table::finalize_compilation_unit()
../../gcc-10-20200419/gcc/cgraphunit.c:2974
Please submit a full bug 

[Bug c/95145] New: [10/11 Regression]internal compiler error: in analyze_functions, at cgraphunit.c:1380

2020-05-14 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95145

Bug ID: 95145
   Summary: [10/11 Regression]internal compiler error: in
analyze_functions, at cgraphunit.c:1380
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void foo ( ) 
{ 
extern __inline int bar ( ) { }

int baz ( ) { return bar ; } 
}


$ gcc-11 --version
gcc (GCC) 11.0.0 20200510 (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.


$ gcc-11 test.c 
test.c: In function ‘foo’:
test.c:4:22: error: nested function ‘bar’ declared ‘extern’
4 |  extern __inline int bar ( ) { }
  |  ^~~
test.c: In function ‘baz’:
test.c:6:23: warning: returning ‘int (*)()’ from a function with return type
‘int’ makes integer from pointer without a cast
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion]8;;]
6 |  int baz ( ) { return bar ; }
  |   ^~~
At top level:
cc1: internal compiler error: in analyze_functions, at cgraphunit.c:1380
0x63a1df analyze_functions
../../gcc-11-20200510/gcc/cgraphunit.c:1380
0x966712 symbol_table::finalize_compilation_unit()
../../gcc-11-20200510/gcc/cgraphunit.c:2971
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.


$ gcc-10 test.c 
test.c: In function ‘foo’:
test.c:4:22: error: nested function ‘bar’ declared ‘extern’
4 |  extern __inline int bar ( ) { }
  |  ^~~
test.c: In function ‘baz’:
test.c:6:23: warning: returning ‘int (*)()’ from a function with return type
‘int’ makes integer from pointer without a cast
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion]8;;]
6 |  int baz ( ) { return bar ; }
  |   ^~~
At top level:
cc1: internal compiler error: in analyze_functions, at cgraphunit.c:1380
0x639ab1 analyze_functions
../../gcc-10-20200419/gcc/cgraphunit.c:1380
0x963fc2 symbol_table::finalize_compilation_unit()
../../gcc-10-20200419/gcc/cgraphunit.c:2974
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/95124] New: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396

2020-05-14 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95124

Bug ID: 95124
   Summary: internal compiler error: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
diag_attr_exclusions, at attribs.c:396
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

int foo () { 
x; 

void bar ( ) 
{ 
struct struct_0 * var_5 = ( { int x  __attribute__ ( ( unused ,
section ( ".text" ) ) ) ; } )
}
}


$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:3:2: error: ‘x’ undeclared (first use in this function)
3 |  x;
  |  ^
reduced.c:3:2: note: each undeclared identifier is reported only once for each
function it appears in
reduced.c: In function ‘bar’:
reduced.c:7:10: internal compiler error: tree check: expected class ‘type’,
have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396
7 |   struct struct_0 * var_5 = ( { int x  __attribute__ ( ( unused ,
section ( ".text" ) ) ) ; } )
  |  ^~~~
0x731f2f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-10-20200419/gcc/tree.c:9777
0x5eaf44 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-10-20200419/gcc/tree.h:3410
0x5eaf44 diag_attr_exclusions
../../gcc-10-20200419/gcc/attribs.c:396
0x7d4fda diag_attr_exclusions
../../gcc-10-20200419/gcc/attribs.c:379
0x7d6fb5 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc-10-20200419/gcc/attribs.c:694
0x7f2554 start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
../../gcc-10-20200419/gcc/c/c-decl.c:5117
0x84cdd5 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2271
0x8302bf c_parser_compound_statement_nostart
../../gcc-10-20200419/gcc/c/c-parser.c:5718
0x831f6f c_parser_postfix_expression
../../gcc-10-20200419/gcc/c/c-parser.c:9113
0x834ada c_parser_unary_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8273
0x83632d c_parser_cast_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8115
0x8365b9 c_parser_binary_expression
../../gcc-10-20200419/gcc/c/c-parser.c:7918
0x837595 c_parser_conditional_expression
../../gcc-10-20200419/gcc/c/c-parser.c:7652
0x837bb0 c_parser_expr_no_commas
../../gcc-10-20200419/gcc/c/c-parser.c:7569
0x83aa4c c_parser_initializer
../../gcc-10-20200419/gcc/c/c-parser.c:5227
0x83aa4c c_parser_initializer
../../gcc-10-20200419/gcc/c/c-parser.c:5219
0x84d193 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2248
0x8302bf c_parser_compound_statement_nostart
../../gcc-10-20200419/gcc/c/c-parser.c:5718
0x84c8c4 c_parser_compound_statement
../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2505
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 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-9 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:3:2: error: ‘x’ undeclared (first use in this function)
3 |  x;
  |  ^
reduced.c:3:2: note: each undeclared identifier is reported only once for each
function it appears in
reduced.c: In function ‘bar’:
reduced.c:7:37: error: section attribute cannot be specified for local
variables
7 |   struct struct_0 * var_5 = ( { int x  __attribute__ ( ( unused ,
section ( ".text" ) ) ) ; } )
  | ^
reduced.c:7:29: error: void value not ignored as it ought to be
7 |   struct struct_0 * var_5 = ( { int x  __attribute__ ( ( unused ,
section ( ".text" ) ) ) ; } )
  | ^
reduced.c:8:2: error: expected ‘,’ or ‘;’ before ‘}’ token
8 |  }
  |  ^
redu

[Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87

2020-05-06 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

Bug ID: 94968
   Summary: [10 Regression] internal compiler error: tree check:
expected class ‘type’, have ‘exceptional’ (error_mark)
in useless_type_conversion_p, at gimple-expr.c:87
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int foo() { 
__builtin_speculation_safe_value ( 1 , x );
}



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 test.c 
test.c: In function ‘foo’:
test.c:3:41: error: ‘x’ undeclared (first use in this function)
3 |  __builtin_speculation_safe_value ( 1 , x );
  | ^
test.c:3:41: note: each undeclared identifier is reported only once for each
function it appears in
test.c:3:2: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
3 |  __builtin_speculation_safe_value ( 1 , x );
  |  ^~~~
0x731f2f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-10-20200419/gcc/tree.c:9777
0x665cf0 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-10-20200419/gcc/tree.h:3410
0x665cf0 useless_type_conversion_p(tree_node*, tree_node*)
../../gcc-10-20200419/gcc/gimple-expr.c:87
0x8919e4 speculation_safe_value_resolve_params
../../gcc-10-20200419/gcc/c-family/c-common.c:6720
0x8919e4 resolve_overloaded_builtin(unsigned int, tree_node*, vec*)
../../gcc-10-20200419/gcc/c-family/c-common.c:7407
0x81a6c9 c_build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*)
../../gcc-10-20200419/gcc/c/c-typeck.c:3199
0x838cde c_parser_postfix_expression_after_primary
../../gcc-10-20200419/gcc/c/c-parser.c:10501
0x8307a1 c_parser_postfix_expression
../../gcc-10-20200419/gcc/c/c-parser.c:10176
0x834ada c_parser_unary_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8273
0x83632d c_parser_cast_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8115
0x8365b9 c_parser_binary_expression
../../gcc-10-20200419/gcc/c/c-parser.c:7918
0x837595 c_parser_conditional_expression
../../gcc-10-20200419/gcc/c/c-parser.c:7652
0x837bb0 c_parser_expr_no_commas
../../gcc-10-20200419/gcc/c/c-parser.c:7569
0x837e11 c_parser_expression
../../gcc-10-20200419/gcc/c/c-parser.c:10637
0x8385b7 c_parser_expression_conv
../../gcc-10-20200419/gcc/c/c-parser.c:10670
0x82dd0b c_parser_statement_after_labels
../../gcc-10-20200419/gcc/c/c-parser.c:6301
0x82ff71 c_parser_compound_statement_nostart
../../gcc-10-20200419/gcc/c/c-parser.c:5805
0x84c8c4 c_parser_compound_statement
../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2505
0x8566e3 c_parser_external_declaration
../../gcc-10-20200419/gcc/c/c-parser.c:1745
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 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-9 test.c 
test.c: In function ‘foo’:
test.c:3:41: error: ‘x’ undeclared (first use in this function)
3 |  __builtin_speculation_safe_value ( 1 , x );
  | ^
test.c:3:41: note: each undeclared identifier is reported only once for each
function it appears in
test.c:3:2: error: both arguments must be compatible
3 |  __builtin_speculation_safe_value ( 1 , x );
  |  ^~~~

[Bug c/94966] New: [10 regression] internal compiler error: tree check: expected function_type or method_type, have integer_type in gimplify_call_expr, at gimplify.c:3433

2020-05-06 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94966

Bug ID: 94966
   Summary: [10 regression] internal compiler error: tree check:
expected function_type or method_type, have
integer_type in gimplify_call_expr, at gimplify.c:3433
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

extern void (*x) () ; 

void foo() 
{ 
x(); 
} 

char x [] = { foo };



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 test.c 
test.c:9:6: error: conflicting types for ‘x’
9 | char x [] = { foo };
  |  ^
test.c:2:15: note: previous declaration of ‘x’ was here
2 | extern void (*x) () ;
  |   ^
test.c:9:15: warning: initialization of ‘char’ from ‘void (*)()’ makes integer
from pointer without a cast
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion]8;;]
9 | char x [] = { foo };
  |   ^~~
test.c:9:15: note: (near initialization for ‘x[0]’)
test.c:9:15: error: initializer element is not computable at load time
test.c:9:15: note: (near initialization for ‘x[0]’)
test.c: In function ‘foo’:
test.c:6:2: internal compiler error: tree check: expected function_type or
method_type, have integer_type in gimplify_call_expr, at gimplify.c:3433
6 |  x();
  |  ^~~
0x731ae0 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc-10-20200419/gcc/tree.c:9727
0x677c3f tree_check2(tree_node*, char const*, int, char const*, tree_code,
tree_code)
../../gcc-10-20200419/gcc/tree.h:3306
0x677c3f gimplify_call_expr
../../gcc-10-20200419/gcc/gimplify.c:3433
0xafe096 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13580
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb0199b gimplify_bind_expr
../../gcc-10-20200419/gcc/gimplify.c:1424
0xafe0b3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13809
0xb15927 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb15927 gimplify_body(tree_node*, bool)
../../gcc-10-20200419/gcc/gimplify.c:14857
0xb15e53 gimplify_function_tree(tree_node*)
../../gcc-10-20200419/gcc/gimplify.c:15030
0x9607d7 cgraph_node::analyze()
../../gcc-10-20200419/gcc/cgraphunit.c:670
0x9633f7 analyze_functions
../../gcc-10-20200419/gcc/cgraphunit.c:1227
0x963fc2 symbol_table::finalize_compilation_unit()
../../gcc-10-20200419/gcc/cgraphunit.c:2974
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 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-9 test.c 
test.c:9:6: error: conflicting types for ‘x’
9 | char x [] = { foo };
  |  ^
test.c:2:15: note: previous declaration of ‘x’ was here
2 | extern void (*x) () ;
  |   ^
test.c:9:15: warning: initialization of ‘char’ from ‘void (*)()’ makes integer
from pointer without a cast [-Wint-conversion]
9 | char x [] = { foo };
  |   ^~~
test.c:9:15: note: (near initialization for ‘x[0]’)
test.c:9:15: error: initializer element is not computable at load time
test.c:9:15: note: (near initialization for ‘x[0]’)
test.c:6: confused by earlier errors, bailing out

[Bug c/94903] New: internal compiler error: in assign_temp, at function.c:982

2020-05-01 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94903

Bug ID: 94903
   Summary: internal compiler error: in assign_temp, at
function.c:982
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

extern struct S var ; 

void foo ( ) 
{ 
asm volatile ( "" : "=r" ( var ) ) ; 
}



$ gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 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-9 reduced.c 
during RTL pass: expand
reduced.c: In function ‘foo’:
reduced.c:6:2: internal compiler error: in assign_temp, at function.c:982
6 |  asm volatile ( "" : "=r" ( var ) ) ;
  |  ^~~
0x5b5f1e assign_temp(tree_node*, int, int)
../../gcc-9-20200425/gcc/function.c:982
0x6e81e1 expand_asm_stmt
../../gcc-9-20200425/gcc/cfgexpand.c:3196
0x6ebc95 expand_gimple_stmt_1
../../gcc-9-20200425/gcc/cfgexpand.c:3688
0x6ebc95 expand_gimple_stmt
../../gcc-9-20200425/gcc/cfgexpand.c:3850
0x6f0b9f expand_gimple_basic_block
../../gcc-9-20200425/gcc/cfgexpand.c:5890
0x6f2f2e execute
../../gcc-9-20200425/gcc/cfgexpand.c:6513
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-8 --version
gcc (GCC) 8.4.1 20200424
Copyright (C) 2018 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-8 reduced.c 
during RTL pass: expand
reduced.c: In function ‘foo’:
reduced.c:6:2: internal compiler error: in assign_temp, at function.c:977
  asm volatile ( "" : "=r" ( var ) ) ;
  ^~~
0x5b7eca assign_temp(tree_node*, int, int)
../../gcc-8-20200424/gcc/function.c:977
0x6d51e6 expand_asm_stmt
../../gcc-8-20200424/gcc/cfgexpand.c:3097
0x6d9077 expand_gimple_stmt_1
../../gcc-8-20200424/gcc/cfgexpand.c:3635
0x6d9077 expand_gimple_stmt
../../gcc-8-20200424/gcc/cfgexpand.c:3804
0x6db37f expand_gimple_basic_block
../../gcc-8-20200424/gcc/cfgexpand.c:5837
0x6e08a6 execute
../../gcc-8-20200424/gcc/cfgexpand.c:6443
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-7.4.0 --version
gcc (GCC) 7.4.0
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-7.4.0 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:6:2: internal compiler error: in assign_temp, at function.c:968
  asm volatile ( "" : "=r" ( var ) ) ;
  ^~~
0x7db8b1 assign_temp(tree_node*, int, int)
../../gcc-7.4.0/gcc/function.c:968
0x6aa146 expand_asm_stmt
../../gcc-7.4.0/gcc/cfgexpand.c:3036
0x6addc7 expand_gimple_stmt_1
../../gcc-7.4.0/gcc/cfgexpand.c:3568
0x6addc7 expand_gimple_stmt
../../gcc-7.4.0/gcc/cfgexpand.c:3737
0x6af37f expand_gimple_basic_block
../../gcc-7.4.0/gcc/cfgexpand.c:5744
0x6b44c6 execute
../../gcc-7.4.0/gcc/cfgexpand.c:6357
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/94902] New: [10 Regression] internal compiler error: output_operand: invalid use of register 'frame'

2020-05-01 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94902

Bug ID: 94902
   Summary: [10 Regression] internal compiler error:
output_operand: invalid use of register 'frame'
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

void foo ( void ) { 
register int x asm ( "19" ) ; 
x -- ; 
}



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:5:1: error: frame cannot be used in ‘asm’ here
5 | }
  | ^
during RTL pass: final
reduced.c:5:1: internal compiler error: output_operand: invalid use of register
'frame'
0xa58bb6 output_operand_lossage(char const*, ...)
../../gcc-10-20200419/gcc/final.c:3609
0xa58ee1 output_operand(rtx_def*, int)
../../gcc-10-20200419/gcc/final.c:4051
0xa59a3d output_asm_insn(char const*, rtx_def**)
../../gcc-10-20200419/gcc/final.c:3963
0xa5d3e7 final_scan_insn_1
../../gcc-10-20200419/gcc/final.c:3106
0xa5d6ab final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-10-20200419/gcc/final.c:3152
0xa5d7b6 final_1
../../gcc-10-20200419/gcc/final.c:2020
0xa5e374 rest_of_handle_final
../../gcc-10-20200419/gcc/final.c:4658
0xa5e374 execute
../../gcc-10-20200419/gcc/final.c:4736
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 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-9 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:5:1: error: frame cannot be used in asm here
5 | }
  | ^
reduced.c:5: confused by earlier errors, bailing out

[Bug c/94842] New: [8/9/10 Regression] internal compiler error: in gimplify_label_expr, at gimplify.c:2573

2020-04-29 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94842

Bug ID: 94842
   Summary: [8/9/10 Regression] internal compiler error: in
gimplify_label_expr, at gimplify.c:2573
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

_Atomic float x = 5 ;

void foo ( int arg_0 ) 
{ 
void bar ( float arg_0 [ ( int ) ( x += 2 ) ] ) { } 
}



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 test.c 
test.c: In function ‘bar’:
test.c:6:27: internal compiler error: in gimplify_label_expr, at
gimplify.c:2573
6 |  void bar ( float arg_0 [ ( int ) ( x += 2 ) ] ) { }
  |   ^~
0x66df8d gimplify_label_expr
../../gcc-10-20200419/gcc/gimplify.c:2573
0xafd7d2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13847
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xafe48b gimplify_statement_list
../../gcc-10-20200419/gcc/gimplify.c:1869
0xafe48b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:14052
0xb12883 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb12883 gimplify_compound_expr
../../gcc-10-20200419/gcc/gimplify.c:6025
0xafdb30 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13598
0xb031b0 internal_get_tmp_var
../../gcc-10-20200419/gcc/gimplify.c:619
0xb057ca get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
../../gcc-10-20200419/gcc/gimplify.c:674
0xb057ca gimplify_save_expr
../../gcc-10-20200419/gcc/gimplify.c:6073
0xafdeb6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13908
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xafe48b gimplify_statement_list
../../gcc-10-20200419/gcc/gimplify.c:1869
0xafe48b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:14052
0xb15927 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb15927 gimplify_body(tree_node*, bool)
../../gcc-10-20200419/gcc/gimplify.c:14857
0xb15e53 gimplify_function_tree(tree_node*)
../../gcc-10-20200419/gcc/gimplify.c:15030
0xe49ee0 gimplify_all_functions
../../gcc-10-20200419/gcc/tree-nested.c:3521
0xe49ecf gimplify_all_functions
../../gcc-10-20200419/gcc/tree-nested.c:3524
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 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-9 test.c 
test.c: In function ‘bar’:
test.c:6:27: internal compiler error: in gimplify_label_expr, at
gimplify.c:2498
6 |  void bar ( float arg_0 [ ( int ) ( x += 2 ) ] ) { }
  |   ^~
0x5b6fa9 gimplify_label_expr
../../gcc-9-20200425/gcc/gimplify.c:2498
0x5b6fa9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9-20200425/gcc/gimplify.c:12750
0x86a736 gimplify_stmt(tree_node**, gimple**)
../../gcc-9-20200425/gcc/gimplify.c:6721
0x86897b gimplify_statement_list
../../gcc-9-20200425/gcc/gimplify.c:1794
0x86897b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9-20200425/gcc/gimplify.c:12940
0x86a736 gimplify_stmt(tree_node**, gimple**)
../../gcc-9-20200425/gcc/gimplify.c:6721
0x86ae1b gimplify_compound_expr
../../gcc-9-20200425/gcc/gimplify.c:5930
0x868546 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9-20200425/gcc/gimplify.c:12501
0x86c1b0 internal_get_t

[Bug c/94780] New: [9/10] internal compiler error: Segmentation fault

2020-04-26 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94780

Bug ID: 94780
   Summary: [9/10] internal compiler error: Segmentation fault
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

_Atomic double x ;

void foo ( void ) 
{ 

x = 1 ; 

for ( int i = 0 ; i < 1 ; i ++ ) 
{ 
double y = x /= 3 ; 
unsigned int bar (int s) { return  s;}
}
}



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:5:6: internal compiler error: Segmentation fault
5 | void foo ( void )
  |  ^~~
0xdab3ef crash_signal
../../gcc-10-20200419/gcc/toplev.c:328
0x7f6b59 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc-10-20200419/gcc/tree.h:3400
0xe4eb96 convert_nonlocal_reference_op
../../gcc-10-20200419/gcc/tree-nested.c:1065
0x1069c5a 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-10-20200419/gcc/tree.c:11996
0xae7c94 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc-10-20200419/gcc/gimple-walk.c:268
0xae7d6c 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-10-20200419/gcc/gimple-walk.c:596
0xae7f00 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc-10-20200419/gcc/gimple-walk.c:51
0xae7df1 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-10-20200419/gcc/gimple-walk.c:686
0xae7f00 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc-10-20200419/gcc/gimple-walk.c:51
0xae7df1 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-10-20200419/gcc/gimple-walk.c:686
0xae7f00 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc-10-20200419/gcc/gimple-walk.c:51
0xae7df1 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-10-20200419/gcc/gimple-walk.c:686
0xae7f00 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc-10-20200419/gcc/gimple-walk.c:51
0xe4a324 walk_body
../../gcc-10-20200419/gcc/tree-nested.c:713
0xe4a324 walk_function
../../gcc-10-20200419/gcc/tree-nested.c:724
0xe4a324 walk_all_functions
../../gcc-10-20200419/gcc/tree-nested.c:789
0xe50788 lower_nested_functions(tree_node*)
../../gcc-10-20200419/gcc/tree-nested.c:3551
0x96060c cgraph_node::analyze()
../../gcc-10-20200419/gcc/cgraphunit.c:676
0x9633f7 analyze_functions
../../gcc-10-20200419/gcc/cgraphunit.c:1227
0x963fc2 symbol_table::finalize_compilation_unit()
../../gcc-10-20200419/gcc/cgraphunit.c:2974
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 reduced.c 
reduced.c: In function ‘foo’:
reduced.c:5:6: internal compiler error: Segmentation fault
5 | 

[Bug c/94755] New: [10 Regression] internal compiler error: Segmentation fault

2020-04-24 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94755

Bug ID: 94755
   Summary: [10 Regression] internal compiler error: Segmentation
fault
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

extern void foo ( void ) ; 

void bar ( double x ) 
{ 
if ( x == __builtin_speculation_safe_value() ) 
foo ( ) ; 
} 



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c: In function ‘bar’:
reduced.c:6:2: error: too few arguments to function
‘__builtin_speculation_safe_value’
6 |  if ( x == __builtin_speculation_safe_value() )
  |  ^~
reduced.c:6:2: internal compiler error: Segmentation fault
0xdab3ef crash_signal
../../gcc-10-20200419/gcc/toplev.c:328
0x89132f vec::operator[](unsigned int)
../../gcc-10-20200419/gcc/vec.h:867
0x89132f resolve_overloaded_builtin(unsigned int, tree_node*, vec*)
../../gcc-10-20200419/gcc/c-family/c-common.c:7405
0x81a6c9 c_build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*)
../../gcc-10-20200419/gcc/c/c-typeck.c:3199
0x838cde c_parser_postfix_expression_after_primary
../../gcc-10-20200419/gcc/c/c-parser.c:10501
0x8307a1 c_parser_postfix_expression
../../gcc-10-20200419/gcc/c/c-parser.c:10176
0x834ada c_parser_unary_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8273
0x83632d c_parser_cast_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8115
0x83671a c_parser_binary_expression
../../gcc-10-20200419/gcc/c/c-parser.c:8041
0x837595 c_parser_conditional_expression
../../gcc-10-20200419/gcc/c/c-parser.c:7652
0x837bb0 c_parser_expr_no_commas
../../gcc-10-20200419/gcc/c/c-parser.c:7569
0x837e11 c_parser_expression
../../gcc-10-20200419/gcc/c/c-parser.c:10637
0x8394a4 c_parser_expression_conv
../../gcc-10-20200419/gcc/c/c-parser.c:10670
0x8394a4 c_parser_condition
../../gcc-10-20200419/gcc/c/c-parser.c:6329
0x839597 c_parser_paren_condition
../../gcc-10-20200419/gcc/c/c-parser.c:6349
0x82e3e0 c_parser_if_statement
../../gcc-10-20200419/gcc/c/c-parser.c:6528
0x82e3e0 c_parser_statement_after_labels
../../gcc-10-20200419/gcc/c/c-parser.c:6160
0x82ff71 c_parser_compound_statement_nostart
../../gcc-10-20200419/gcc/c/c-parser.c:5805
0x84c8c4 c_parser_compound_statement
../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2505
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 reduced.c 
reduced.c: In function ‘bar’:
reduced.c:6:2: error: too few arguments to function
‘__builtin_speculation_safe_value’
6 |  if ( x == __builtin_speculation_safe_value() )
  |  ^~

[Bug c/94731] New: [10 Regression] internal compiler error: in fold_convert_loc, at fold-const.c:2558

2020-04-23 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94731

Bug ID: 94731
   Summary: [10 Regression] internal compiler error: in
fold_convert_loc, at fold-const.c:2558
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

int x = - 1 << 0 ; 

int foo () 
{ 
switch ( x ) 
case - 1 << 0 : 
break ; 
}

int x[] = { 1 };



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c:11:5: error: conflicting types for ‘x’
   11 | int x[] = { 1 };
  | ^
reduced.c:2:5: note: previous definition of ‘x’ was here
2 | int x = - 1 << 0 ;
  | ^
during GIMPLE pass: cfg
reduced.c: In function ‘foo’:
reduced.c:4:5: internal compiler error: in fold_convert_loc, at
fold-const.c:2558
4 | int foo ()
  | ^~~
0x65b384 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc-10-20200419/gcc/fold-const.c:2558
0xdf7852 convert_single_case_switch
../../gcc-10-20200419/gcc/tree-cfgcleanup.c:110
0xdf7852 cleanup_control_expr_graph
../../gcc-10-20200419/gcc/tree-cfgcleanup.c:145
0xdf7852 cleanup_control_flow_bb
../../gcc-10-20200419/gcc/tree-cfgcleanup.c:252
0xdf7a95 cleanup_control_flow_pre
../../gcc-10-20200419/gcc/tree-cfgcleanup.c:886
0xdf8c4b cleanup_tree_cfg_noloop
../../gcc-10-20200419/gcc/tree-cfgcleanup.c:1055
0xdf9428 cleanup_tree_cfg(unsigned int)
../../gcc-10-20200419/gcc/tree-cfgcleanup.c:1165
0xdf03a4 execute_build_cfg
../../gcc-10-20200419/gcc/tree-cfg.c:376
0xdf03a4 execute
../../gcc-10-20200419/gcc/tree-cfg.c:405
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 reduced.c 
reduced.c:11:5: error: conflicting types for ‘x’
   11 | int x[] = { 1 };
  | ^
reduced.c:2:5: note: previous definition of ‘x’ was here
2 | int x = - 1 << 0 ;
  | ^
reduced.c:4: confused by earlier errors, bailing out

[Bug c/94730] New: [10 Regression] internal compiler error: in fold_convert_loc, at fold-const.c:2435

2020-04-23 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94730

Bug ID: 94730
   Summary: [10 Regression] internal compiler error: in
fold_convert_loc, at fold-const.c:2435
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

int x , y ; 

int foo ( ) 
{ 
x = 0 ; 
y = 0 ; 

if (x != 0) 
y ++; 
else 
x ++ ; 

} 

int x [] = { 0 } ;



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c:16:5: error: conflicting types for ‘x’
   16 | int x [] = { 0 } ;
  | ^
reduced.c:2:5: note: previous declaration of ‘x’ was here
2 | int x , y ;
  | ^
reduced.c: In function ‘foo’:
reduced.c:12:5: internal compiler error: in fold_convert_loc, at
fold-const.c:2435
   12 |   x ++ ;
  |   ~~^~
0x65b582 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc-10-20200419/gcc/fold-const.c:2435
0xb12707 gimplify_self_mod_expr(tree_node**, gimple**, gimple**, bool,
tree_node*)
../../gcc-10-20200419/gcc/gimplify.c:3186
0xafd218 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13538
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb133cc gimplify_cond_expr
../../gcc-10-20200419/gcc/gimplify.c:4269
0xafdafe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13565
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xafe48b gimplify_statement_list
../../gcc-10-20200419/gcc/gimplify.c:1869
0xafe48b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:14052
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb0199b gimplify_bind_expr
../../gcc-10-20200419/gcc/gimplify.c:1424
0xafe0b3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13809
0xb15927 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb15927 gimplify_body(tree_node*, bool)
../../gcc-10-20200419/gcc/gimplify.c:14857
0xb15e53 gimplify_function_tree(tree_node*)
../../gcc-10-20200419/gcc/gimplify.c:15030
0x9607d7 cgraph_node::analyze()
../../gcc-10-20200419/gcc/cgraphunit.c:670
0x9633f7 analyze_functions
../../gcc-10-20200419/gcc/cgraphunit.c:1227
0x963fc2 symbol_table::finalize_compilation_unit()
../../gcc-10-20200419/gcc/cgraphunit.c:2974
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 reduced.c 
reduced.c:16:5: error: conflicting types for ‘x’
   16 | int x [] = { 0 } ;
  | ^
reduced.c:2:5: note: previous declaration of ‘x’ was here
2 | int x , y ;
  | ^
reduced.c:12: confused by earlier errors, bailing out

[Bug c/94726] New: internal compiler error: in uniform_vector_p, at tree.c:11214

2020-04-22 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94726

Bug ID: 94726
   Summary: internal compiler error: in uniform_vector_p, at
tree.c:11214
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

typedef unsigned int type __attribute__ ( ( vector_size ( 8 ) ) ) ; 

type a , b; 

void foo ( void ) { 
type var = { 2 , 2 } ; 
b = __builtin_shuffle ( a , var ) ;
} 


void * a [ ] = { } ; 



$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ gcc-10 reduced.c 
reduced.c:12:8: error: conflicting types for ‘a’
   12 | void * a [ ] = { } ;
  |^
reduced.c:4:6: note: previous declaration of ‘a’ was here
4 | type a , b;
  |  ^
reduced.c: In function ‘foo’:
reduced.c:8:6: internal compiler error: in uniform_vector_p, at tree.c:11214
8 |  b = __builtin_shuffle ( a , var ) ;
  |  ^
0x736228 uniform_vector_p(tree_node const*)
../../gcc-10-20200419/gcc/tree.c:11214
0x1184786 gimple_vec_same_elem_p(tree_node*, tree_node* (*)(tree_node*))
/home/john/Documents/fuzz/gcc/10-20200419/build/gcc/gimple-match.c:1002
0x12ab6ca gimple_simplify_VEC_PERM_EXPR
   
/home/john/Documents/fuzz/gcc/10-20200419/build/gcc/gimple-match.c:122872
0x1188bca gimple_resimplify3
../../gcc-10-20200419/gcc/gimple-match-head.c:394
0x11d49aa gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
../../gcc-10-20200419/gcc/gimple-match-head.c:1059
0xad0b2f fold_stmt_1
../../gcc-10-20200419/gcc/gimple-fold.c:5087
0xb14771 gimplify_modify_expr
../../gcc-10-20200419/gcc/gimplify.c:5942
0xafd53c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13608
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb03327 gimplify_and_add(tree_node*, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:486
0xb03327 internal_get_tmp_var
../../gcc-10-20200419/gcc/gimplify.c:642
0xafc8ff get_formal_tmp_var(tree_node*, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:663
0xafc8ff gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:14609
0xb14595 gimplify_modify_expr
../../gcc-10-20200419/gcc/gimplify.c:5792
0xafd53c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:13608
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xafe48b gimplify_statement_list
../../gcc-10-20200419/gcc/gimplify.c:1869
0xafe48b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-10-20200419/gcc/gimplify.c:14052
0xb00bd6 gimplify_stmt(tree_node**, gimple**)
../../gcc-10-20200419/gcc/gimplify.c:6825
0xb0199b gimplify_bind_expr
../../gcc-10-20200419/gcc/gimplify.c:1424
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 reduced.c 
reduced.c:12:8: error: conflicting types for ‘a’
   12 | void * a [ ] = { } ;
  |^
reduced.c:4:6: note: previous declaration of ‘a’ was here
4 | type a , b;
  |  ^

[Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396

2020-04-22 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705

Bug ID: 94705
   Summary: [10 Regression] internal compiler error: tree check:
expected class ‘type’, have ‘exceptional’ (error_mark)
in diag_attr_exclusions, at attribs.c:396
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (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.



$ cat test.c 
void sub_0 (void * arg_0){}

int sub_1 ( unsigned arg_0 ) { 
if ( sub_0 ( sub_2 ) ) 
{ 
; 
} 

void __attribute__ ( ( noinline ) ) sub_2 ( int arg_0 );
}



$ gcc-10 test.c 
test.c: In function ‘sub_1’:
test.c:4:15: error: ‘sub_2’ undeclared (first use in this function); did you
mean ‘sub_1’?
4 |  if ( sub_0 ( sub_2 ) )
  |   ^
  |   sub_1
test.c:4:15: note: each undeclared identifier is reported only once for each
function it appears in
test.c:9:2: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396
9 |  void __attribute__ ( ( noinline ) ) sub_2 ( int arg_0 );
  |  ^~~~
0x731f2f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-10-20200419/gcc/tree.c:9777
0x5eaf44 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-10-20200419/gcc/tree.h:3410
0x5eaf44 diag_attr_exclusions
../../gcc-10-20200419/gcc/attribs.c:396
0x7d4fda diag_attr_exclusions
../../gcc-10-20200419/gcc/attribs.c:379
0x7d6fb5 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc-10-20200419/gcc/attribs.c:694
0x7f2554 start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
../../gcc-10-20200419/gcc/c/c-decl.c:5117
0x84cdd5 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2271
0x8302bf c_parser_compound_statement_nostart
../../gcc-10-20200419/gcc/c/c-parser.c:5718
0x84c8c4 c_parser_compound_statement
../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
../../gcc-10-20200419/gcc/c/c-parser.c:2505
0x8566e3 c_parser_external_declaration
../../gcc-10-20200419/gcc/c/c-parser.c:1745
0x8571e1 c_parser_translation_unit
../../gcc-10-20200419/gcc/c/c-parser.c:1618
0x8571e1 c_parse_file()
../../gcc-10-20200419/gcc/c/c-parser.c:21745
0x8ae2cb c_common_parse_file()
../../gcc-10-20200419/gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 test.c 
test.c: In function ‘sub_1’:
test.c:4:15: error: ‘sub_2’ undeclared (first use in this function); did you
mean ‘sub_1’?
4 |  if ( sub_0 ( sub_2 ) )
  |   ^
  |   sub_1
test.c:4:15: note: each undeclared identifier is reported only once for each
function it appears in
test.c:9: confused by earlier errors, bailing out

[Bug inline-asm/93160] New: ICE: in expand_expr_addr_expr_1, at expr.c:8070

2020-01-05 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93160

Bug ID: 93160
   Summary: ICE: in expand_expr_addr_expr_1, at expr.c:8070
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

extern long unsigned int sub_0 ( const char * ) ; 

extern void * sub_1 ( long unsigned int ) ; 

extern int var_0 ; 

void * var_1 = & var_0 ; 

register int var_0 asm ( "%ecx" ) ; 



$ gcc-snapshot10 --versiongcc (GCC) 10.0.0 20191229 (experimental)
Copyright (C) 2019 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-snapshot10 test.c 
test.c:10:14: warning: call-clobbered register used for global register
variable
   10 | register int var_0 asm ( "%ecx" ) ;
  |  ^
test.c:10:1: internal compiler error: in expand_expr_addr_expr_1, at
expr.c:8070
   10 | register int var_0 asm ( "%ecx" ) ;
  | ^~~~
0x633aab expand_expr_addr_expr_1
../../gcc-10-20191229/gcc/expr.c:8070
0xa1b8f9 expand_expr_addr_expr
../../gcc-10-20191229/gcc/expr.c:8183
0xa1b8f9 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-10-20191229/gcc/expr.c:11358
0x105d9ab expand_expr
../../gcc-10-20191229/gcc/expr.h:282
0x105d9ab output_constant
../../gcc-10-20191229/gcc/varasm.c:4993
0x105e274 output_constant
../../gcc-10-20191229/gcc/varasm.c:4901
0x105e274 assemble_variable_contents
../../gcc-10-20191229/gcc/varasm.c:2148
0x10636ba assemble_variable(tree_node*, int, int, int)
../../gcc-10-20191229/gcc/varasm.c:2327
0x1066f29 varpool_node::assemble_decl()
../../gcc-10-20191229/gcc/varpool.c:586
0x938c1c output_in_order
../../gcc-10-20191229/gcc/cgraphunit.c:2566
0x938c1c symbol_table::compile()
../../gcc-10-20191229/gcc/cgraphunit.c:2803
0x93ae8c symbol_table::compile()
../../gcc-10-20191229/gcc/cgraphunit.c:2719
0x93ae8c symbol_table::finalize_compilation_unit()
../../gcc-10-20191229/gcc/cgraphunit.c:2986
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/93072] New: ICE: Segmentation fault

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

Bug ID: 93072
   Summary: ICE: Segmentation fault
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 


void foo ( void ) { } 

static void bar ( void ) 
{ 
inline void foo ( void ) ; 

if ( foo == 0 ) ; 
} 



$ gcc-snapshot10 --version
gcc (GCC) 10.0.0 20191201 (experimental)
Copyright (C) 2019 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-snapshot10 test.c 
test.c: In function ‘bar’:
test.c:5:13: internal compiler error: Segmentation fault
5 | static void bar ( void )
  | ^~~
0xd5be5f crash_signal
../../gcc-10-20191201/gcc/toplev.c:328
0xab2547 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc-10-20191201/gcc/tree.h:3386
0xab2547 unshare_body
../../gcc-10-20191201/gcc/gimplify.c:955
0xab25e9 unshare_body
../../gcc-10-20191201/gcc/gimplify.c:962
0xad76c2 gimplify_body(tree_node*, bool)
../../gcc-10-20191201/gcc/gimplify.c:14601
0xad7b33 gimplify_function_tree(tree_node*)
../../gcc-10-20191201/gcc/gimplify.c:14757
0x923eb7 cgraph_node::analyze()
../../gcc-10-20191201/gcc/cgraphunit.c:669
0x9268ef analyze_functions
../../gcc-10-20191201/gcc/cgraphunit.c:1212
0x9274a2 symbol_table::finalize_compilation_unit()
../../gcc-10-20191201/gcc/cgraphunit.c:2925
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/92799] New: ICE: in get, at cgraph.h:1339

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

Bug ID: 92799
   Summary: ICE: in get, at cgraph.h:1339
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

static void __attribute__ ( ( weakref ( "bar" ) ) ) foo ( void ) { } 

extern void foo ( void ) ;



$ gcc-snapshot10 --version
gcc (GCC) 10.0.0 20191201 (experimental)
Copyright (C) 2019 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-snapshot10 test.c 
test.c:2:53: internal compiler error: in get, at cgraph.h:1339
2 | static void __attribute__ ( ( weakref ( "bar" ) ) ) foo ( void ) { }
  | ^~~
0x618bad cgraph_node::get(tree_node const*)
../../gcc-10-20191201/gcc/cgraph.h:1339
0x619c7a cgraph_node::get(tree_node const*)
../../gcc-10-20191201/gcc/tree.h:3387
0x619c7a cgraph_node::analyze()
../../gcc-10-20191201/gcc/cgraphunit.c:622
0x9268ef analyze_functions
../../gcc-10-20191201/gcc/cgraphunit.c:1212
0x9274a2 symbol_table::finalize_compilation_unit()
../../gcc-10-20191201/gcc/cgraphunit.c:2925
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-snapshot9 --version
gcc (GCC) 9.2.1 20191123
Copyright (C) 2019 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-snapshot9 test.c 
test.c:2:53: internal compiler error: Segmentation fault
2 | static void __attribute__ ( ( weakref ( "bar" ) ) ) foo ( void ) { }
  | ^~~
0xa8c89f crash_signal
../../gcc-9-20191123/gcc/toplev.c:326
0x71f7c2 cgraph_node* dyn_cast(symtab_node*)
../../gcc-9-20191123/gcc/is-a.h:227
0x71f7c2 cgraph_node::get(tree_node const*)
../../gcc-9-20191123/gcc/cgraph.h:1339
0x71f7c2 cgraph_node::analyze()
../../gcc-9-20191123/gcc/cgraphunit.c:640
0x721e77 analyze_functions
../../gcc-9-20191123/gcc/cgraphunit.c:1126
0x722a62 symbol_table::finalize_compilation_unit()
../../gcc-9-20191123/gcc/cgraphunit.c:2837
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug middle-end/92725] New: ICE: Segmentation fault during GIMPLE pass

2019-11-29 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92725

Bug ID: 92725
   Summary: ICE: Segmentation fault during GIMPLE pass
   Product: gcc
   Version: 8.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 0.c 

int global ; 

void foo() ; 

__attribute__((returns_twice)) int bar() ; 

void baz(int, int); 

void main ( ) 
{ 
int x;
for ( ; ; ) 
foo(); 
baz(bar(), global); 
}



$ gcc-snapshot8 --version
gcc (GCC) 8.3.1 20191122
Copyright (C) 2018 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-snapshot8 0.c 
during GIMPLE pass: *build_cgraph_edges
0.c: In function ‘main’:
0.c:10:6: internal compiler error: Segmentation fault
 void main ( )
  ^~~~
0xa654af crash_signal
../../gcc-8-20191122/gcc/toplev.c:325
0x8275a0 useless_type_conversion_p(tree_node*, tree_node*)
../../gcc-8-20191122/gcc/gimple-expr.c:70
0x70606d types_compatible_p
../../gcc-8-20191122/gcc/gimple-expr.h:66
0x70606d gimple_check_call_args
../../gcc-8-20191122/gcc/cgraph.c:3798
0x70606d gimple_check_call_matching_types(gimple*, tree_node*, bool)
../../gcc-8-20191122/gcc/cgraph.c:3848
0x708346 symbol_table::create_edge(cgraph_node*, cgraph_node*, gcall*,
profile_count, bool)
../../gcc-8-20191122/gcc/cgraph.c:879
0x708544 cgraph_node::create_edge(cgraph_node*, gcall*, profile_count)
../../gcc-8-20191122/gcc/cgraph.c:914
0x70df6e execute
../../gcc-8-20191122/gcc/cgraphbuild.c:322
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 inline-asm/92615] New: [8/9/10 Regression] ICE in extract_insn

2019-11-21 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92615

Bug ID: 92615
   Summary: [8/9/10 Regression] ICE in extract_insn
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void foo ( ) 
{ 
char bar ;
if ( bar ) 
{
volatile int * bar = & bar ; 
__asm__ ( "cmp $1, %1" : "=@ccng" ( bar ) : "r" ( 1 ) ) ;
}
}



$ gcc-snapshot10 --version
gcc (GCC) 10.0.0 20191117 (experimental)
Copyright (C) 2019 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-snapshot10 test.c 
test.c: In function ‘foo’:
test.c:7:30: warning: initialization of ‘volatile int *’ from incompatible
pointer type ‘volatile int **’
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types\-Wincompatible-pointer-types]8;;\]
7 | volatile int * bar = & bar ;
  |  ^
test.c:10:1: error: unrecognizable insn:
   10 | }
  | ^
(insn 12 11 16 4 (set (mem/f/c:DI (plus:DI (reg/f:DI 77 virtual-stack-vars)
(const_int -16 [0xfff0])) [1 bar+0 S8 A64])
(zero_extend:DI (reg:QI 84))) "test.c":8:9 -1
 (nil))
during RTL pass: vregs
test.c:10:1: internal compiler error: in extract_insn, at recog.c:2311
0x6a08f8 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc-10-20191117/gcc/rtl-error.c:108
0x6a0914 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc-10-20191117/gcc/rtl-error.c:116
0x69ecfb extract_insn(rtx_insn*)
../../gcc-10-20191117/gcc/recog.c:2311
0xa73663 instantiate_virtual_regs_in_insn
../../gcc-10-20191117/gcc/function.c:1607
0xa73663 instantiate_virtual_regs
../../gcc-10-20191117/gcc/function.c:1977
0xa73663 execute
../../gcc-10-20191117/gcc/function.c:2026
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-snapshot9 --version
gcc (GCC) 9.2.1 20191116
Copyright (C) 2019 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-snapshot9 test.c 
test.c: In function ‘foo’:
test.c:7:30: warning: initialization of ‘volatile int *’ from incompatible
pointer type ‘volatile int **’ [-Wincompatible-pointer-types]
7 | volatile int * bar = & bar ;
  |  ^
test.c:10:1: error: unrecognizable insn:
   10 | }
  | ^
(insn 12 11 16 4 (set (mem/f/c:DI (plus:DI (reg/f:DI 77 virtual-stack-vars)
(const_int -16 [0xfff0])) [1 bar+0 S8 A64])
(zero_extend:DI (reg:QI 84))) "test.c":8:9 -1
 (nil))
during RTL pass: vregs
test.c:10:1: internal compiler error: in extract_insn, at recog.c:2310
0x5c27c3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc-9-20191116/gcc/rtl-error.c:108
0x5c27df _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc-9-20191116/gcc/rtl-error.c:116
0x5c18da extract_insn(rtx_insn*)
../../gcc-9-20191116/gcc/recog.c:2310
0x825053 instantiate_virtual_regs_in_insn
../../gcc-9-20191116/gcc/function.c:1605
0x825053 instantiate_virtual_regs
../../gcc-9-20191116/gcc/function.c:1975
0x825053 execute
../../gcc-9-20191116/gcc/function.c:2024
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



$ gcc-snapshot8 --version
gcc (GCC) 8.3.1 20191108
Copyright (C) 2018 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-snapshot8 test.c 
test.c: In function ‘foo’:
test.c:7:30: warning: initialization of ‘volatile int *’ from incompatible
pointer type ‘volatile int **’ [-Wincompatible-pointer-types]
 volatile int * bar = & bar ;
  ^
test.c:10:1: error: unrecognizable insn:
 }
 ^
(insn 12 11 16 4 (set (mem/f/c:DI (plus:DI (reg/f:DI 82 virtual-sta

[Bug middle-end/92478] [8 Regression] ICE: Segmentation fault

2019-11-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92478

--- Comment #3 from John X  ---
(In reply to Jakub Jelinek from comment #1)
> Started to ICE with r247622, got fixed with r262742.

Would the ICE in gcc-8 be fixed?

[Bug middle-end/92478] [8 Regression] ICE: Segmentation fault

2019-11-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92478

--- Comment #2 from John X  ---
(In reply to Jakub Jelinek from comment #1)
> Started to ICE with r247622, got fixed with r262742.

Thanks~

[Bug c/92478] New: [8 Regression] ICE: Segmentation fault

2019-11-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92478

Bug ID: 92478
   Summary: [8 Regression] ICE: Segmentation fault
   Product: gcc
   Version: 8.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void bar ( char * a , unsigned int b ) 
{
static char const array[] = "STRING" ; 
__builtin_strcpy (a , [b == 0] );  
} 


$ gcc-snapshot7 --version
gcc (GCC) 7.4.1 20191107
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-snapshot7 test.c 
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status


$ gcc-snapshot8 --version
gcc (GCC) 8.3.1 20191108
Copyright (C) 2018 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-snapshot8 test.c 
during RTL pass: expand
test.c: In function ‘bar’:
test.c:6:5: internal compiler error: Segmentation fault
 __builtin_strcpy (a , [b == 0] );
 ^~
0xa6514f crash_signal
../../gcc-8-20191108/gcc/toplev.c:325
0xcf9403 selt
../../gcc-8-20191108/gcc/wide-int.cc:404
0xcf9403 wi::lts_p_large(long const*, unsigned int, unsigned int, long const*,
unsigned int)
../../gcc-8-20191108/gcc/wide-int.cc:480
0x6b4773 bool wi::lts_p >,
generic_wide_int >
>(generic_wide_int > const&,
generic_wide_int > const&)
../../gcc-8-20191108/gcc/wide-int.h:1873
0x6b4773 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 > const&)
../../gcc-8-20191108/gcc/wide-int.h:3170
0x6b4773 tree_int_cst_lt(tree_node const*, tree_node const*)
../../gcc-8-20191108/gcc/tree.h:5740
0x6b4773 check_access
../../gcc-8-20191108/gcc/builtins.c:3125
0x6bf482 expand_builtin_strcpy
../../gcc-8-20191108/gcc/builtins.c:3780
0x6bf482 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
../../gcc-8-20191108/gcc/builtins.c:6978
0x7c9591 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-8-20191108/gcc/expr.c:11062
0x6d935a expand_expr
../../gcc-8-20191108/gcc/expr.h:280
0x6d935a expand_call_stmt
../../gcc-8-20191108/gcc/cfgexpand.c:2704
0x6d935a expand_gimple_stmt_1
../../gcc-8-20191108/gcc/cfgexpand.c:3638
0x6d935a expand_gimple_stmt
../../gcc-8-20191108/gcc/cfgexpand.c:3804
0x6daf1f expand_gimple_basic_block
../../gcc-8-20191108/gcc/cfgexpand.c:5837
0x6e0446 execute
../../gcc-8-20191108/gcc/cfgexpand.c:6443
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug target/92469] ICE: output_operand: invalid use of register 'frame' in 7/8/9/10

2019-11-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92469

--- Comment #4 from John X  ---
Sorry, I submitted the same comment twice due to the bad network environment. I
don't know how to delete the duplicate one. Any one could help me?

[Bug target/92469] [9/10 Regression] ICE: output_operand: invalid use of register 'frame'

2019-11-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92469

--- Comment #3 from John X  ---
Yes, you are right. If we change "19" to "20", it still ICEs for older versions
of GCC.


$ cat test2.c 

void foo ( void ) 
{ 
register int x asm ( "20" ) ; 

int y = x;
}


$ gcc-snapshot8 --version
gcc (GCC) 8.3.1 20191108
Copyright (C) 2018 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-snapshot8 test2.c 
during RTL pass: final
test2.c: In function ‘foo’:
test2.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
 }
 ^
0x7de0b3 output_operand_lossage(char const*, ...)
../../gcc-8-20191108/gcc/final.c:3628
0xd5c00c ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc-8-20191108/gcc/config/i386/i386.c:18608
0x7de3e1 output_operand(rtx_def*, int)
../../gcc-8-20191108/gcc/final.c:4070
0x7dee79 output_asm_insn(char const*, rtx_def**)
../../gcc-8-20191108/gcc/final.c:3982
0x7e044c final_scan_insn_1
../../gcc-8-20191108/gcc/final.c:3178
0x7e076b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-8-20191108/gcc/final.c:3224
0x7e0a2c final_1
../../gcc-8-20191108/gcc/final.c:2091
0x7e1444 rest_of_handle_final
../../gcc-8-20191108/gcc/final.c:4677
0x7e1444 execute
../../gcc-8-20191108/gcc/final.c:4755
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc-snapshot7 --version
gcc (GCC) 7.4.1 20191107
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-snapshot7 test2.c 
test2.c: In function ‘foo’:
test2.c:7:1: internal compiler error: in print_reg, at config/i386/i386.c:18041
 }
 ^
0xca56e3 print_reg(rtx_def*, int, _IO_FILE*)
../../gcc-7-20191107/gcc/config/i386/i386.c:18038
0xcc7ddc ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc-7-20191107/gcc/config/i386/i386.c:18778
0x7a5701 output_operand(rtx_def*, int)
../../gcc-7-20191107/gcc/final.c:3894
0x7a616b output_asm_insn(char const*, rtx_def**)
../../gcc-7-20191107/gcc/final.c:3810
0x7a6ab9 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-7-20191107/gcc/final.c:3061
0x7a7c7c final(rtx_insn*, _IO_FILE*, int)
../../gcc-7-20191107/gcc/final.c:2051
0x7a85d9 rest_of_handle_final
../../gcc-7-20191107/gcc/final.c:4492
0x7a85d9 execute
../../gcc-7-20191107/gcc/final.c:4569
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/92469] [9/10 Regression] ICE: output_operand: invalid use of register 'frame'

2019-11-12 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92469

--- Comment #2 from John X  ---
Yes, you are right. If we change "19" to "20", it still ICEs for older versions
of GCC.


$ cat test2.c 

void foo ( void ) 
{ 
register int x asm ( "20" ) ; 

int y = x;
}


$ gcc-snapshot8 --version
gcc (GCC) 8.3.1 20191108
Copyright (C) 2018 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-snapshot8 test2.c 
during RTL pass: final
test2.c: In function ‘foo’:
test2.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
 }
 ^
0x7de0b3 output_operand_lossage(char const*, ...)
../../gcc-8-20191108/gcc/final.c:3628
0xd5c00c ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc-8-20191108/gcc/config/i386/i386.c:18608
0x7de3e1 output_operand(rtx_def*, int)
../../gcc-8-20191108/gcc/final.c:4070
0x7dee79 output_asm_insn(char const*, rtx_def**)
../../gcc-8-20191108/gcc/final.c:3982
0x7e044c final_scan_insn_1
../../gcc-8-20191108/gcc/final.c:3178
0x7e076b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-8-20191108/gcc/final.c:3224
0x7e0a2c final_1
../../gcc-8-20191108/gcc/final.c:2091
0x7e1444 rest_of_handle_final
../../gcc-8-20191108/gcc/final.c:4677
0x7e1444 execute
../../gcc-8-20191108/gcc/final.c:4755
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc-snapshot7 --version
gcc (GCC) 7.4.1 20191107
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-snapshot7 test2.c 
test2.c: In function ‘foo’:
test2.c:7:1: internal compiler error: in print_reg, at config/i386/i386.c:18041
 }
 ^
0xca56e3 print_reg(rtx_def*, int, _IO_FILE*)
../../gcc-7-20191107/gcc/config/i386/i386.c:18038
0xcc7ddc ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc-7-20191107/gcc/config/i386/i386.c:18778
0x7a5701 output_operand(rtx_def*, int)
../../gcc-7-20191107/gcc/final.c:3894
0x7a616b output_asm_insn(char const*, rtx_def**)
../../gcc-7-20191107/gcc/final.c:3810
0x7a6ab9 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-7-20191107/gcc/final.c:3061
0x7a7c7c final(rtx_insn*, _IO_FILE*, int)
../../gcc-7-20191107/gcc/final.c:2051
0x7a85d9 rest_of_handle_final
../../gcc-7-20191107/gcc/final.c:4492
0x7a85d9 execute
../../gcc-7-20191107/gcc/final.c:4569
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/92469] New: [9/10 Regression] ICE: output_operand: invalid use of register 'frame'

2019-11-11 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92469

Bug ID: 92469
   Summary: [9/10 Regression] ICE: output_operand: invalid use of
register 'frame'
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void foo ( void ) 
{ 
register int x asm ( "19" ) ; 

int y = x;
}


My command line to compile GCC is

../sourecode_dir/configure --prefix=../install_dir --enable-languages=c,c++
--disable-multilib


$ gcc-snapshot10 --version
gcc (GCC) 10.0.0 20191110 (experimental)
Copyright (C) 2019 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-snapshot10 test.c 
during RTL pass: final
test.c: In function ‘foo’:
test.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
7 | }
  | ^
0x9bff96 output_operand_lossage(char const*, ...)
../../gcc-10-20191110/gcc/final.c:3610
0x9c11a1 output_operand(rtx_def*, int)
../../gcc-10-20191110/gcc/final.c:4052
0x9c1660 output_asm_insn(char const*, rtx_def**)
../../gcc-10-20191110/gcc/final.c:3964
0x9c3674 final_scan_insn_1
../../gcc-10-20191110/gcc/final.c:3107
0x9c395b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-10-20191110/gcc/final.c:3153
0x9c3a56 final_1
../../gcc-10-20191110/gcc/final.c:2021
0x9c4654 rest_of_handle_final
../../gcc-10-20191110/gcc/final.c:4659
0x9c4654 execute
../../gcc-10-20191110/gcc/final.c:4737
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ gcc-snapshot9 --version
gcc (GCC) 9.2.1 20191109
Copyright (C) 2019 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-snapshot9 test.c 
during RTL pass: final
test.c: In function ‘foo’:
test.c:7:1: internal compiler error: output_operand: invalid use of register
'frame'
7 | }
  | ^
0x7f4ce6 output_operand_lossage(char const*, ...)
../../gcc-9-20191109/gcc/final.c:3610
0xd63454 ix86_print_operand(_IO_FILE*, rtx_def*, int)
../../gcc-9-20191109/gcc/config/i386/i386.c:18356
0x7f5011 output_operand(rtx_def*, int)
../../gcc-9-20191109/gcc/final.c:4052
0x7f5acc output_asm_insn(char const*, rtx_def**)
../../gcc-9-20191109/gcc/final.c:3964
0x7f7192 final_scan_insn_1
../../gcc-9-20191109/gcc/final.c:3107
0x7f73eb final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
../../gcc-9-20191109/gcc/final.c:3153
0x7f76c4 final_1
../../gcc-9-20191109/gcc/final.c:2021
0x7f80a4 rest_of_handle_final
../../gcc-9-20191109/gcc/final.c:4659
0x7f80a4 execute
../../gcc-9-20191109/gcc/final.c:4737
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.


This ICE seems doesn't affect gcc-8 and earlier versions.


$ gcc-snapshot8 --version
gcc (GCC) 8.3.1 20191101
Copyright (C) 2018 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-snapshot8 test.c 
test.c: In function ‘foo’:
test.c:4:18: error: the register specified for ‘x’ is not general enough to be
used as a register variable
 register int x asm ( "19" ) ;
  ^

[Bug c/92377] New: [7/8 Regression] ICE: Segmentation fault

2019-11-05 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92377

Bug ID: 92377
   Summary: [7/8 Regression] ICE: Segmentation fault
   Product: gcc
   Version: 8.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int foo ( void ) ; 

int __attribute__ ( ( returns_twice ) ) bar ( void ) ; 

void baz ( ) 
{ 
int x ; 
if ( x > 10 ) 
exit ( 0 ) ; 
return 0 ;
x = foo() + (bar() + 1); 
}


$ gcc-snapshot8 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/8-20191101/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/8-20191101/install/libexec/gcc/x86_64-pc-linux-gnu/8.3.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-8-20191101/configure
--prefix=/home/tom/Documents/gcc/8-20191101/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 8.3.1 20191101 (GCC) 


$ gcc-snapshot8 test.c 
test.c: In function ‘baz’:
test.c:10:9: warning: implicit declaration of function ‘exit’
[-Wimplicit-function-declaration]
 exit ( 0 ) ;
 ^~~~
test.c:10:9: warning: incompatible implicit declaration of built-in function
‘exit’
test.c:10:9: note: include ‘’ or provide a declaration of ‘exit’
test.c:1:1:
+#include 

test.c:10:9:
 exit ( 0 ) ;
 ^~~~
test.c:11:12: warning: ‘return’ with a value, in function returning void
 return 0 ;
^
test.c:6:6: note: declared here
 void baz ( )
  ^~~
during RTL pass: expand
test.c:12:7: internal compiler error: Segmentation fault
 x = foo() + (bar() + 1);
 ~~^
0xa6512f crash_signal
../../gcc-8-20191101/gcc/toplev.c:325
0x7d6d19 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc-8-20191101/gcc/expr.c:8653
0x6d93e2 expand_gimple_stmt_1
../../gcc-8-20191101/gcc/cfgexpand.c:3743
0x6d93e2 expand_gimple_stmt
../../gcc-8-20191101/gcc/cfgexpand.c:3804
0x6daf1f expand_gimple_basic_block
../../gcc-8-20191101/gcc/cfgexpand.c:5837
0x6e0446 execute
../../gcc-8-20191101/gcc/cfgexpand.c:6443
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ gcc-snapshot7 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/7-20191031/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/7-20191031/install/libexec/gcc/x86_64-pc-linux-gnu/7.4.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-7-20191031/configure
--prefix=/home/tom/Documents/gcc/7-20191031/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 7.4.1 20191031 (GCC) 


$ gcc-snapshot7 test.c 
test.c: In function ‘baz’:
test.c:10:9: warning: implicit declaration of function ‘exit’
[-Wimplicit-function-declaration]
 exit ( 0 ) ;
 ^~~~
test.c:10:9: warning: incompatible implicit declaration of built-in function
‘exit’
test.c:10:9: note: include ‘’ or provide a declaration of ‘exit’
test.c:11:12: warning: ‘return’ with a value, in function returning void
 return 0 ;
^
test.c:6:6: note: declared here
 void baz ( )
  ^~~
test.c:12:7: internal compiler error: Segmentation fault
 x = foo() + (bar() + 1);
 ~~^
0xa13c6f crash_signal
../../gcc-7-20191031/gcc/toplev.c:337
0x79f2e4 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc-7-20191031/gcc/expr.c:8526
0x6ae915 expand_gimple_stmt_1
../../gcc-7-20191031/gcc/cfgexpand.c:3676
0x6ae915 expand_gimple_stmt
../../gcc-7-20191031/gcc/cfgexpand.c:3737
0x6af83f expand_gimple_basic_block
../../gcc-7-20191031/gcc/cfgexpand.c:5744
0x6b4976 execute
../../gcc-7-20191031/gcc/cfgexpand.c:6357
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.



But if I use gcc-6.5 or gcc-5.5 to compile it, there is no ICE.

[Bug inline-asm/92368] New: internal compiler error: Segmentation fault in gcc-7.4.1

2019-11-04 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92368

Bug ID: 92368
   Summary: internal compiler error: Segmentation fault in
gcc-7.4.1
   Product: gcc
   Version: 7.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: inline-asm
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 
void foo ( ) 
{ 
float x ; 
asm ( "" : : "pir" ( x ) ) ; 
}


My gcc snapshot version


$ gcc-snapshot7 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/7-20191031/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/7-20191031/install/libexec/gcc/x86_64-pc-linux-gnu/7.4.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-7-20191031/configure
--prefix=/home/tom/Documents/gcc/7-20191031/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 7.4.1 20191031 (GCC) 


$ gcc-snapshot7 test.c 
test.c: In function ‘foo’:
test.c:5:1: internal compiler error: Segmentation fault
 }
 ^
0xa13c6f crash_signal
../../gcc-7-20191031/gcc/toplev.c:337
0x8da92b base_plus_disp_to_reg
../../gcc-7-20191031/gcc/lra-constraints.c:3057
0x8dec43 process_address_1
../../gcc-7-20191031/gcc/lra-constraints.c:3404
0x8df48c process_address
../../gcc-7-20191031/gcc/lra-constraints.c:3514
0x8df48c curr_insn_transform
../../gcc-7-20191031/gcc/lra-constraints.c:3830
0x8e488e lra_constraints(bool)
../../gcc-7-20191031/gcc/lra-constraints.c:4869
0x8d3ee4 lra(_IO_FILE*)
../../gcc-7-20191031/gcc/lra.c:2394
0x892521 do_reload
../../gcc-7-20191031/gcc/ira.c:5485
0x892521 execute
../../gcc-7-20191031/gcc/ira.c:5669
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


gcc-7.4.0 is affected.


$ gcc-7.4.0 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/7.4.0/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/7.4.0/install/libexec/gcc/x86_64-pc-linux-gnu/7.4.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-7.4.0/configure
--prefix=/home/tom/Documents/gcc/7.4.0/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 7.4.0 (GCC) 


$ gcc-7.4.0 test.c 
test.c: In function ‘foo’:
test.c:5:1: internal compiler error: Segmentation fault
 }
 ^
0x9d957f crash_signal
../../gcc-7.4.0/gcc/toplev.c:337
0x8a037b base_plus_disp_to_reg
../../gcc-7.4.0/gcc/lra-constraints.c:3057
0x8a4653 process_address_1
../../gcc-7.4.0/gcc/lra-constraints.c:3404
0x8a4e9c process_address
../../gcc-7.4.0/gcc/lra-constraints.c:3514
0x8a4e9c curr_insn_transform
../../gcc-7.4.0/gcc/lra-constraints.c:3830
0x8aa26e lra_constraints(bool)
../../gcc-7.4.0/gcc/lra-constraints.c:4869
0x899934 lra(_IO_FILE*)
../../gcc-7.4.0/gcc/lra.c:2392
0x857fb1 do_reload
../../gcc-7.4.0/gcc/ira.c:5478
0x857fb1 execute
../../gcc-7.4.0/gcc/ira.c:5662
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


gcc-8 gcc-9 are unaffected.

[Bug c/92355] New: ICE: Segmentation fault crash_signal toplev.c:325

2019-11-04 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92355

Bug ID: 92355
   Summary: ICE: Segmentation fault crash_signal toplev.c:325
   Product: gcc
   Version: 8.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 
void foo ( ) 
{ 
void bar() char str[({ void func(){ int x; } )]; 
}


My gcc-8's snapshot version is gcc-8-20191101


$ gcc-snapshot8 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/8-20191101/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/8-20191101/install/libexec/gcc/x86_64-pc-linux-gnu/8.3.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-8-20191101/configure
--prefix=/home/tom/Documents/gcc/8-20191101/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 8.3.1 20191101 (GCC) 


$ gcc-snapshot8 test.c 
test.c: In function ‘bar’:
test.c:3:5: internal compiler error: Segmentation fault
 void bar() char str[({ void func(){ int x; } )];
 ^~~~
0xa6512f crash_signal
../../gcc-8-20191101/gcc/toplev.c:325
0x5fe28f c_push_function_context()
../../gcc-8-20191101/gcc/c/c-decl.c:9710
0x63bbec c_parser_declaration_or_fndef
../../gcc-8-20191101/gcc/c/c-parser.c:2245
0x63a3da c_parser_compound_statement_nostart
../../gcc-8-20191101/gcc/c/c-parser.c:5002
0x621ca7 c_parser_postfix_expression
../../gcc-8-20191101/gcc/c/c-parser.c:8007
0x6292a2 c_parser_unary_expression
../../gcc-8-20191101/gcc/c/c-parser.c:7323
0x62a07f c_parser_cast_expression
../../gcc-8-20191101/gcc/c/c-parser.c:7167
0x62a2f3 c_parser_binary_expression
../../gcc-8-20191101/gcc/c/c-parser.c:6970
0x62b0c5 c_parser_conditional_expression
../../gcc-8-20191101/gcc/c/c-parser.c:6708
0x62b600 c_parser_expr_no_commas
../../gcc-8-20191101/gcc/c/c-parser.c:6625
0x6285b0 c_parser_direct_declarator_inner
../../gcc-8-20191101/gcc/c/c-parser.c:3818
0x63adf0 c_parser_declaration_or_fndef
../../gcc-8-20191101/gcc/c/c-parser.c:1988
0x63bace c_parser_declaration_or_fndef
../../gcc-8-20191101/gcc/c/c-parser.c:2305
0x63a3da c_parser_compound_statement_nostart
../../gcc-8-20191101/gcc/c/c-parser.c:5002
0x63a526 c_parser_compound_statement
../../gcc-8-20191101/gcc/c/c-parser.c:4914
0x63bb83 c_parser_declaration_or_fndef
../../gcc-8-20191101/gcc/c/c-parser.c:2343
0x64169f c_parser_external_declaration
../../gcc-8-20191101/gcc/c/c-parser.c:1643
0x641ed9 c_parser_translation_unit
../../gcc-8-20191101/gcc/c/c-parser.c:1524
0x641ed9 c_parse_file()
../../gcc-8-20191101/gcc/c/c-parser.c:18493
0x6847c6 c_common_parse_file()
../../gcc-8-20191101/gcc/c-family/c-opts.c:1147
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.


I test it with gcc-7.4.0, the result is following


$ gcc-7.4.0 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/7.4.0/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/7.4.0/install/libexec/gcc/x86_64-pc-linux-gnu/7.4.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-7.4.0/configure
--prefix=/home/tom/Documents/gcc/7.4.0/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 7.4.0 (GCC) 


$ gcc-7.4.0 test.c 
test.c: In function ‘bar’:
test.c:3:5: internal compiler error: Segmentation fault
 void bar() char str[({ void func(){ int x; } )];
 ^~~~
0x9d957f crash_signal
../../gcc-7.4.0/gcc/toplev.c:337
0x599171 c_push_function_context()
../../gcc-7.4.0/gcc/c/c-decl.c:9516
0x5bd964 c_parser_declaration_or_fndef
../../gcc-7.4.0/gcc/c/c-parser.c:2051
0x5d1dca c_parser_compound_statement_nostart
../../gcc-7.4.0/gcc/c/c-parser.c:4841
0x5d53f4 c_parser_postfix_expression
../../gcc-7.4.0/gcc/c/c-parser.c:7678
0x5c362a c_parser_unary_expression
../../gcc-7.4.0/gcc/c/c-parser.c:7061
0x5c4307 c_parser_cast_expression
../../gcc-7.4.0/gcc/c/c-parser.c:6893
0x5c4512 c_parser_binary_expression
../../gcc-7.4.0/gcc/c/c-parser.c:6702
0x5c4fc5 c_parser_conditional_expression
../../gcc-7.4.0/gcc/c/c-parser.c:6470
0x5c54c0 c_parser_expr_no_commas
../../gcc-7.4.0/gcc/c/c-parser.c:6387
0x5ced8d c_parser_direct_declarator_inner
../../gcc-7.4.0/gcc/c/c-parser.c:3603
0x5bc7bf c_parser_declaration_or_fndef
../../gcc-7.4.0/gcc/c/c-parser.c:1796
0x5bce1f c_parser_declaration_or_fndef
../../gcc-7.4.0/gcc/c/c-parser.c:2085
0x5d1dca c_parser_compound_statement_nostart
../../gcc-7.4.0/gcc/c/c-parser.c:4841
0x5d20fe c_parser_compound_statement
../../gcc-7.4.0/gcc/c/c-parser.c:4752
0x

[Bug c/92352] New: ICE in force_constant_size

2019-11-04 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92352

Bug ID: 92352
   Summary: ICE in force_constant_size
   Product: gcc
   Version: 9.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ gcc-9.2.0 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/9.2.0/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/9.2.0/install/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-9.2.0/configure
--prefix=/home/tom/Documents/gcc/9.2.0/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 9.2.0 (GCC) 

$ cat test.c 

void foo ( long int arg ) 
{ 
int var[arg] ; 
asm volatile ( "" : "+r" ( var ) ) ; 
}


$ gcc-9.2.0 test.c 
test.c: In function ‘foo’:
test.c:5:5: internal compiler error: in force_constant_size, at gimplify.c:712
5 | asm volatile ( "" : "+r" ( var ) ) ;
  | ^~~
0x5b67a9 force_constant_size
../../gcc-9.2.0/gcc/gimplify.c:712
0x8625af gimple_add_tmp_var(tree_node*)
../../gcc-9.2.0/gcc/gimplify.c:750
0x83d016 create_tmp_var(tree_node*, char const*)
../../gcc-9.2.0/gcc/gimple-expr.c:482
0x86b09f create_tmp_from_val
../../gcc-9.2.0/gcc/gimplify.c:541
0x86b09f lookup_tmp_var
../../gcc-9.2.0/gcc/gimplify.c:562
0x86b09f internal_get_tmp_var
../../gcc-9.2.0/gcc/gimplify.c:615
0x86602d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9.2.0/gcc/gimplify.c:13464
0x86d1b7 gimplify_asm_expr
../../gcc-9.2.0/gcc/gimplify.c:6386
0x867860 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9.2.0/gcc/gimplify.c:12834
0x8694e6 gimplify_stmt(tree_node**, gimple**)
../../gcc-9.2.0/gcc/gimplify.c:6718
0x867763 gimplify_statement_list
../../gcc-9.2.0/gcc/gimplify.c:1794
0x867763 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9.2.0/gcc/gimplify.c:12931
0x8694e6 gimplify_stmt(tree_node**, gimple**)
../../gcc-9.2.0/gcc/gimplify.c:6718
0x869ddf gimplify_bind_expr
../../gcc-9.2.0/gcc/gimplify.c:1362
0x866d59 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9.2.0/gcc/gimplify.c:12703
0x8694e6 gimplify_stmt(tree_node**, gimple**)
../../gcc-9.2.0/gcc/gimplify.c:6718
0x86a7c6 gimplify_body(tree_node*, bool)
../../gcc-9.2.0/gcc/gimplify.c:13711
0x86aa75 gimplify_function_tree(tree_node*)
../../gcc-9.2.0/gcc/gimplify.c:13855
0x71f18f cgraph_node::analyze()
../../gcc-9.2.0/gcc/cgraphunit.c:667
0x7216e7 analyze_functions
../../gcc-9.2.0/gcc/cgraphunit.c:1126
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.



I tried the snapshot version gcc-9-20191102, the ICE is nearly same.



$ gcc-snapshot -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/9-20191102/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/9-20191102/install/libexec/gcc/x86_64-pc-linux-gnu/9.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-9-20191102/configure
--prefix=/home/tom/Documents/gcc/9-20191102/install
Thread model: posix
gcc version 9.2.1 20191102 (GCC) 

$ gcc-snapshot test.c 
test.c: In function ‘foo’:
test.c:5:5: internal compiler error: in force_constant_size, at gimplify.c:712
5 | asm volatile ( "" : "+r" ( var ) ) ;
  | ^~~
0x5b698d force_constant_size
../../gcc-9-20191102/gcc/gimplify.c:712
0x862c3f gimple_add_tmp_var(tree_node*)
../../gcc-9-20191102/gcc/gimplify.c:750
0x83d696 create_tmp_var(tree_node*, char const*)
../../gcc-9-20191102/gcc/gimple-expr.c:482
0x86b75f create_tmp_from_val
../../gcc-9-20191102/gcc/gimplify.c:541
0x86b75f lookup_tmp_var
../../gcc-9-20191102/gcc/gimplify.c:562
0x86b75f internal_get_tmp_var
../../gcc-9-20191102/gcc/gimplify.c:615
0x8666dd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9-20191102/gcc/gimplify.c:13466
0x86d877 gimplify_asm_expr
../../gcc-9-20191102/gcc/gimplify.c:6386
0x867f18 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9-20191102/gcc/gimplify.c:12836
0x869ba6 gimplify_stmt(tree_node**, gimple**)
../../gcc-9-20191102/gcc/gimplify.c:6718
0x867e1b gimplify_statement_list
../../gcc-9-20191102/gcc/gimplify.c:1794
0x867e1b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc-9-20191102/gcc/gimplify.c:12933
0x869ba6 gimplify_stmt(tree_node**, g