[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-10-28 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

--- Comment #8 from Jim Wilson  ---
Author: wilson
Date: Wed Oct 28 20:02:01 2015
New Revision: 229505

URL: https://gcc.gnu.org/viewcvs?rev=229505=gcc=rev
Log:
Fix for ICE with -g on testcase with incomplete types.

gcc/c/
PR debug/66068
* c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
after calling build_qualified_type.
gcc/testsuite/
PR debug/66068
* gcc.dg/debug/pr66068.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/debug/pr66068.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-10-28 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

Jim Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Jim Wilson  ---
Fixed on mainline.

Some of the workarounds in verify_type may no longer be necessary.  I haven't
checked.  That should probably be tracked separately if necessary.


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-09-28 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

Jim Wilson  changed:

   What|Removed |Added

 CC||wilson at gcc dot gnu.org

--- Comment #6 from Jim Wilson  ---
The problem is in c_build_qualified_type.  It calls build_qualified_type at the
end which copies every field to create a new type, including TYPE_VFIELD.  But
this is wrong, as TYPE_VFIELD is set in the main variant type, but should not
be set in the qualified type.  To fix this, I would suggest storing the result
of build_qualify_type in a local var, and then clearing C_TYPE_INCOMPLETE_VARS
(aka TYPE_VFIELD) if this is a struct or union type.

An alternative solution would be to clear TYPE_VFIELD somewhere lower down,
such as in build_distinct_type_copy, but that would affect every front end, so
it isn't obvious if this is safe.  Fixing the problem in the C front end is
clearly a safer solution.


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-09-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

--- Comment #7 from Andrew Pinski  ---
gombk in SPEC 2k6 has a similar issue.


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-08-13 Thread matt at use dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

Matt Hargett matt at use dot net changed:

   What|Removed |Added

 CC||matt at use dot net

--- Comment #5 from Matt Hargett matt at use dot net ---
I also saw this when compiling qemu with latest Ubuntu gcc-snapshot 6.0.0
20150722:


/home/matt/src/qemu-arm/exec.c:462:1: error: type variant has different
TYPE_VFIELD
 };
 ^
 record_type 0x7fcf97fcc150 VMStateDescription asm_written type_0 BLK
size integer_cst 0x7fcf98d34f00 type integer_type 0x7fcf98f212a0
bitsizetype constant 576
unit size integer_cst 0x7fcf98dad108 type integer_type 0x7fcf98f211f8
sizetype constant 72
align 64 symtab -1745049488 alias set -1 canonical type 0x7fcf97fcc150
fields field_decl 0x7fcf97c658e8 name
type pointer_type 0x7fcf98f421f8 type integer_type 0x7fcf98f42150
char
asm_written public unsigned DI
size integer_cst 0x7fcf98f1dca8 constant 64
unit size integer_cst 0x7fcf98f1dcc0 constant 8
align 64 symtab -1727089808 alias set -1 canonical type
0x7fcf98f421f8
pointer_to_this pointer_type 0x7fcf98f42a80
unsigned DI file /home/matt/src/qemu-arm/include/migration/vmstate.h
line 128 col 17 size integer_cst 0x7fcf98f1dca8 64 unit size integer_cst
0x7fcf98f1dcc0 8
align 64 offset_align 128
offset integer_cst 0x7fcf98f1dcd8 constant 0
bit offset integer_cst 0x7fcf98f1dd20 constant 0 context record_type
0x7fcf97fcc150 VMStateDescription
chain field_decl 0x7fcf97c65980 unmigratable type integer_type
0x7fcf98f217e0 int
SI file /home/matt/src/qemu-arm/include/migration/vmstate.h line
129 col 9
size integer_cst 0x7fcf98f1dee8 constant 32
unit size integer_cst 0x7fcf98f1df00 constant 4
align 32 offset_align 128 offset integer_cst 0x7fcf98f1dcd8 0 bit
offset integer_cst 0x7fcf98f1dca8 64 context record_type 0x7fcf97fcc150
VMStateDescription chain field_decl 0x7fcf97c65a18 version_id
chain type_decl 0x7fcf97fc4850 D.19553
 record_type 0x7fcf97c63e70 VMStateDescription readonly asm_written BLK
size integer_cst 0x7fcf98d34f00 type integer_type 0x7fcf98f212a0
bitsizetype constant 576
unit size integer_cst 0x7fcf98dad108 type integer_type 0x7fcf98f211f8
sizetype constant 72
align 64 symtab -1748613568 alias set -1 canonical type 0x7fcf97fcc690
fields field_decl 0x7fcf97c658e8 name
type pointer_type 0x7fcf98f421f8 type integer_type 0x7fcf98f42150
char
asm_written public unsigned DI
size integer_cst 0x7fcf98f1dca8 constant 64
unit size integer_cst 0x7fcf98f1dcc0 constant 8
align 64 symtab -1727089808 alias set -1 canonical type
0x7fcf98f421f8
pointer_to_this pointer_type 0x7fcf98f42a80
unsigned DI file /home/matt/src/qemu-arm/include/migration/vmstate.h
line 128 col 17 size integer_cst 0x7fcf98f1dca8 64 unit size integer_cst
0x7fcf98f1dcc0 8
align 64 offset_align 128
offset integer_cst 0x7fcf98f1dcd8 constant 0
bit offset integer_cst 0x7fcf98f1dd20 constant 0 context record_type
0x7fcf97fcc150 VMStateDescription
chain field_decl 0x7fcf97c65980 unmigratable type integer_type
0x7fcf98f217e0 int
SI file /home/matt/src/qemu-arm/include/migration/vmstate.h line
129 col 9
size integer_cst 0x7fcf98f1dee8 constant 32
unit size integer_cst 0x7fcf98f1df00 constant 4
align 32 offset_align 128 offset integer_cst 0x7fcf98f1dcd8 0 bit
offset integer_cst 0x7fcf98f1dca8 64 context record_type 0x7fcf97fcc150
VMStateDescription chain field_decl 0x7fcf97c65a18 version_id
pointer_to_this pointer_type 0x7fcf97c63f18
/home/matt/src/qemu-arm/exec.c:462:1: internal compiler error: verify_type
failed


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-06-16 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

--- Comment #4 from Jan Hubicka hubicka at gcc dot gnu.org ---
The issue is that C FE overloads TYPE_VFIELD by C_TYPE_INCOMPLETE_VARS and
dangle the pointers.
I already work around that in verify_type but the workaround assumes that only
main variants get C_TYPE_INCOMPLETE_VARS which is obviously wrong.  Will extend
the workaround.


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-06-15 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ienkovich at gcc dot gnu.org

--- Comment #3 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
*** Bug 66550 has been marked as a duplicate of this bug. ***


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-05-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
  Component|c   |debug
   Target Milestone|--- |6.0
Summary|error: type variant has |[6 Regression] error: type
   |different TYPE_VFIELD   |variant has different
   ||TYPE_VFIELD

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
Reduced:

struct S a;
const struct S b;
struct S
{
};


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-05-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-05-11
 Ever confirmed|0   |1


[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD

2015-05-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068

--- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org ---
Another testcase:

union U a;
const union U b;
union U
{
};