[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

--- Comment #8 from Martin Liška  ---
Simplified a bit more:

$ cat /tmp/vect.c
unsigned int m;

#define N 128
unsigned int a[N];

unsigned int
__attribute__((noipa))
df_count_refs (bool include_defs)
{
  int size = 0;

  for (unsigned int regno = 0; regno < m; regno++)
if (include_defs)
  size += a[regno];
  return size;
}

int main(int argc, char **argv)
{
  for (unsigned i = 0; i < N; i++)
a[i] = i;

  if (argc == 1)
m = 17;

  unsigned int r = df_count_refs(true);
  __builtin_printf ("r: %d\n", r);
  if (r != 136)
__builtin_abort ();

  return 0;
}

$ g++ /tmp/vect.c -march=haswell -O3 && ./a.out 
r: 17
Aborted (core dumped)

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

--- Comment #7 from Martin Liška  ---
Even easier, use the following self-contained test-case:

$ cat /tmp/vect.c
unsigned int m;

struct df_reg_info
{
  unsigned int n_regs;
};

#define N 128

struct df_reg_info a[N];

unsigned int
__attribute__((noipa))
df_count_refs (bool include_defs)
{
  unsigned int regno;
  int size = 0;
  for (regno = 0; regno < m; regno++)
{
  if (include_defs)
size += a[regno].n_regs;
}
  return size;
}

int main(int argc, char **argv)
{
  for (unsigned i = 0; i < N; i++)
  {
a[i].n_regs = i;
  }

  if (argc == 1)
m = 17;
  unsigned int r = df_count_refs(true);
  __builtin_printf ("r: %d\n", r);

  if (r != 136)
__builtin_abort ();

  return 0;
}

$ marxin@marxinbox:/dev/shm/objdir/gcc> g++ /tmp/vect.c -march=haswell -O0 &&
./a.out 
r: 136
marxin@marxinbox:/dev/shm/objdir/gcc> g++ /tmp/vect.c -march=haswell -O3 &&
./a.out 
r: 17
Aborted (core dumped)

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

--- Comment #6 from Martin Liška  ---
Easier way how to bisect that is to use only these dbg-cnt options:

-O3 -march=haswell -fdbg-cnt=vect_slp:0 -fdbg-cnt=vect_loop:3

which is first bad, vect_loop:2 is fine.

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

--- Comment #5 from Martin Liška  ---
> 3) build df-scan.o with -O3 -march=skylake

same happens for -march=haswell.

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

--- Comment #4 from Martin Liška  ---
Created attachment 47145
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47145=edit
Reproduce patch

Ok, steps to reproduce that:

1) install latest GCC trunk and use it as compiler
2) apply the patch
3) build df-scan.o with -O3 -march=skylake
4) echo 'int foo() {}' | ./xgcc -B. -x c -g -O2 -

during RTL pass: stv
: In function ‘foo’:
:1:1: internal compiler error: in df_reorganize_refs_by_reg_by_reg, at
df-scan.c:1350
0x620205 df_reorganize_refs_by_reg_by_reg
/home/marxin/Programming/gcc/gcc/df-scan.c:1350
0x9cbac4 df_reorganize_refs_by_reg
/home/marxin/Programming/gcc/gcc/df-scan.c:1563
0x9cbac4 df_maybe_reorganize_def_refs(df_ref_order)
/home/marxin/Programming/gcc/gcc/df-scan.c:1717
0x9c077f df_rd_local_compute
/home/marxin/Programming/gcc/gcc/df-problems.c:401
0x9ba6a1 df_analyze_problem(dataflow*, bitmap_head*, int*, int)
/home/marxin/Programming/gcc/gcc/df-core.c:1170
0x9ba799 df_analyze_1
/home/marxin/Programming/gcc/gcc/df-core.c:1227
0x1160cfa convert_scalars_to_vector
/home/marxin/Programming/gcc/gcc/config/i386/i386-features.c:1621
0x1160cfa execute
/home/marxin/Programming/gcc/gcc/config/i386/i386-features.c:1909
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

--- Comment #3 from Martin Liška  ---
One can reproduce that by using df-scan.o from stage2 and libgcc ICEs with -g.

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
   Assignee|marxin at gcc dot gnu.org  |unassigned at gcc dot 
gnu.org

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

Martin Liška  changed:

   What|Removed |Added

   Keywords|needs-bisection |
 CC||rguenth at gcc dot gnu.org

--- Comment #2 from Martin Liška  ---
If I see correctly, it's caused by r277566.

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

Martin Liška  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org

[Bug bootstrap/92301] bootstrap internal compiler error: Aborted free(): invalid next size (fast)

2019-10-31 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92301

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-10-31
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
I see the problem as well with a bit different back-trace. I'll work on that.