[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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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 conditions.  There is NO
warranty; not