[Bug debug/69518] [6 Regression] Flag -g causes "error: type variant has different TYPE_VFIELD"

2016-01-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69518

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 37518
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37518=edit
gcc6-pr69518.patch

Untested fix.  The problem is that when type variants are created, the generic
code copies there also the TYPE_VFIELD aka C_TYPE_INCOMPLETE_VARS.  We clear it
only in the main type variant, but not in other variants, so if not anything
else, it is at least undesirable for GC purposes, plus we leak the C FE use of
that field into the middle-end.

[Bug debug/69518] [6 Regression] Flag -g causes "error: type variant has different TYPE_VFIELD"

2016-01-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69518

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jan 29 20:37:25 2016
New Revision: 232998

URL: https://gcc.gnu.org/viewcvs?rev=232998=gcc=rev
Log:
PR debug/69518
* c-decl.c (finish_struct): Clear C_TYPE_INCOMPLETE_VARS in
all type variants, not just TYPE_MAIN_VARIANT.

* gcc.dg/torture/pr69518.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr69518.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-decl.c
trunk/gcc/testsuite/ChangeLog

[Bug debug/69518] [6 Regression] Flag -g causes "error: type variant has different TYPE_VFIELD"

2016-01-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69518

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jakub Jelinek  ---
Fixed.

[Bug debug/69518] [6 Regression] Flag -g causes "error: type variant has different TYPE_VFIELD"

2016-01-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69518

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org
   Target Milestone|--- |6.0

[Bug debug/69518] [6 Regression] Flag -g causes "error: type variant has different TYPE_VFIELD"

2016-01-27 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69518

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-01-27
 CC||trippels at gcc dot gnu.org
  Component|c   |debug
Summary|Flag -g causes "error: type |[6 Regression] Flag -g
   |variant has different   |causes "error: type variant
   |TYPE_VFIELD"|has different TYPE_VFIELD"
 Ever confirmed|0   |1

--- Comment #1 from Markus Trippelsdorf  ---
markus@x4 tmp % cat bug269.c
struct s_stats a;
typedef struct s_stats cstats;
struct s_stats {
} fn1(cstats p1) {
}

markus@x4 tmp % gcc -c -g bug269.c
bug269.c: In function ‘fn1’:
bug269.c:5:1: error: type variant has different TYPE_VFIELD
 }
 ^
  constant 0>
unit size  constant 0>
align 8 symtab 2001394976 alias set -1 canonical type 0x7fc47749a348
context 
chain >
  constant 0>
unit size  constant 0>
align 8 symtab 2001395216 alias set -1 canonical type 0x7fc47749a348
context 
chain >
bug269.c:5:1: internal compiler error: verify_type failed
0xdc44ad verify_type(tree_node const*)
../../gcc/gcc/tree.c:13888
0x7c522c gen_type_die_with_usage
../../gcc/gcc/dwarf2out.c:22701
0x7c65f6 gen_type_die
../../gcc/gcc/dwarf2out.c:22899
0x7be320 gen_decl_die
../../gcc/gcc/dwarf2out.c:23555
0x7bb364 gen_subprogram_die
../../gcc/gcc/dwarf2out.c:20704
0x7bde6c gen_decl_die
../../gcc/gcc/dwarf2out.c:23468
0x7bedae dwarf2out_decl
../../gcc/gcc/dwarf2out.c:23951
0x7d6538 dwarf2out_early_global_decl
../../gcc/gcc/dwarf2out.c:23624
0x74efeb symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2549

[Bug debug/69518] [6 Regression] Flag -g causes "error: type variant has different TYPE_VFIELD"

2016-01-27 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69518

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
Started with r222606.