public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/98407] New: [11 Regression] ICE: Aborted (in constant_byte_string; free(): invalid pointer)
@ 2020-12-21  7:28 asolokha at gmx dot com
  2020-12-21  8:58 ` [Bug c/98407] [11 Regression] ICE: Aborted (in constant_byte_string; free(): invalid pointer) since r11-6271-g69165332a914f116 marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: asolokha at gmx dot com @ 2020-12-21  7:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98407

            Bug ID: 98407
           Summary: [11 Regression] ICE: Aborted (in constant_byte_string;
                    free(): invalid pointer)
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20201220 snapshot (g:18e86fae2a14f78e70aae06afce6bb9853068bb1)
ICEs when compiling the following testcase w/ -O1:

struct gk {
  int mi;
  int vq[];
};

const struct gk un = { 0, { 0, }, }, og = { 0, { 0, }, };

int
ia (void)
{
  return __builtin_memcmp (&un, &og, sizeof og);
}

% MALLOC_PERTURB_=3 MALLOC_CHECK_=3 gcc-11.0.0 -O1 -c jenyen4s.c
free(): invalid pointer
jenyen4s.c: In function 'ia':
jenyen4s.c:11:3: internal compiler error: Aborted
   11 |   return __builtin_memcmp (&un, &og, sizeof og);
      |   ^~~~~~
0xdf83df crash_signal
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/toplev.c:327
0xa6fe97 constant_byte_string
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/expr.c:11836
0xaa58ef getbyterep(tree_node*, unsigned long*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/fold-const.c:16242
0xad94a7 fold_const_call(combined_fn, tree_node*, tree_node*, tree_node*,
tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/fold-const-call.c:1806
0x921958 fold_builtin_3
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/builtins.c:12034
0x921958 fold_builtin_n
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/builtins.c:12115
0xaa3fca fold_build_call_array_loc(unsigned int, tree_node*, tree_node*, int,
tree_node**)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/fold-const.c:13827
0x8297e1 build_function_call_vec(unsigned int, vec<unsigned int, va_heap,
vl_ptr>, tree_node*, vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc,
vl_embed>*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-typeck.c:3155
0x84924a c_parser_postfix_expression_after_primary
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:10470
0x840599 c_parser_postfix_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:10143
0x844a6a c_parser_unary_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:8230
0x84629b c_parser_cast_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:8072
0x846547 c_parser_binary_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:7875
0x8478c8 c_parser_conditional_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:7598
0x847fc4 c_parser_expr_no_commas
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:7513
0x848275 c_parser_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:10606
0x848abb c_parser_expression_conv
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:10645
0x83e927 c_parser_statement_after_labels
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:6160
0x8400c2 c_parser_compound_statement_nostart
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:5788
0x85e435 c_parser_compound_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201220/work/gcc-11-20201220/gcc/c/c-parser.c:5597

There's a memory corruption issue somewhere, so it's better reproducible w/
Valgrind, MALLOC_PERTURB_ functionality provided by glibc, or some similar
means.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-21  9:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21  7:28 [Bug c/98407] New: [11 Regression] ICE: Aborted (in constant_byte_string; free(): invalid pointer) asolokha at gmx dot com
2020-12-21  8:58 ` [Bug c/98407] [11 Regression] ICE: Aborted (in constant_byte_string; free(): invalid pointer) since r11-6271-g69165332a914f116 marxin at gcc dot gnu.org
2020-12-21  9:04 ` [Bug tree-optimization/98407] " jakub at gcc dot gnu.org
2020-12-21  9:16 ` cvs-commit at gcc dot gnu.org
2020-12-21  9:18 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).