* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
@ 2015-05-11 14:56 ` mpolacek at gcc dot gnu.org
2015-05-11 14:56 ` mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-05-11 14:56 UTC (permalink / raw)
To: gcc-bugs
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
{
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
2015-05-11 14:56 ` [Bug debug/66068] [6 Regression] " mpolacek at gcc dot gnu.org
@ 2015-05-11 14:56 ` mpolacek at gcc dot gnu.org
2015-05-11 15:02 ` mpolacek at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-05-11 14:56 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
2015-05-11 14:56 ` [Bug debug/66068] [6 Regression] " mpolacek at gcc dot gnu.org
2015-05-11 14:56 ` mpolacek at gcc dot gnu.org
@ 2015-05-11 15:02 ` mpolacek at gcc dot gnu.org
2015-06-16 5:22 ` trippels at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-05-11 15:02 UTC (permalink / raw)
To: gcc-bugs
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
{
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
` (2 preceding siblings ...)
2015-05-11 15:02 ` mpolacek at gcc dot gnu.org
@ 2015-06-16 5:22 ` trippels at gcc dot gnu.org
2015-08-13 20:21 ` matt at use dot net
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-06-16 5:22 UTC (permalink / raw)
To: gcc-bugs
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. ***
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
` (3 preceding siblings ...)
2015-06-16 5:22 ` trippels at gcc dot gnu.org
@ 2015-08-13 20:21 ` matt at use dot net
2015-09-28 21:39 ` wilson at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: matt at use dot net @ 2015-08-13 20:21 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
` (4 preceding siblings ...)
2015-08-13 20:21 ` matt at use dot net
@ 2015-09-28 21:39 ` wilson at gcc dot gnu.org
2015-09-28 23:05 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: wilson at gcc dot gnu.org @ 2015-09-28 21:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068
Jim Wilson <wilson at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wilson at gcc dot gnu.org
--- Comment #6 from Jim Wilson <wilson at gcc dot gnu.org> ---
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
` (5 preceding siblings ...)
2015-09-28 21:39 ` wilson at gcc dot gnu.org
@ 2015-09-28 23:05 ` pinskia at gcc dot gnu.org
2015-10-28 20:02 ` wilson at gcc dot gnu.org
2015-10-28 20:06 ` wilson at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-09-28 23:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
gombk in SPEC 2k6 has a similar issue.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
` (6 preceding siblings ...)
2015-09-28 23:05 ` pinskia at gcc dot gnu.org
@ 2015-10-28 20:02 ` wilson at gcc dot gnu.org
2015-10-28 20:06 ` wilson at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: wilson at gcc dot gnu.org @ 2015-10-28 20:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068
--- Comment #8 from Jim Wilson <wilson at gcc dot gnu.org> ---
Author: wilson
Date: Wed Oct 28 20:02:01 2015
New Revision: 229505
URL: https://gcc.gnu.org/viewcvs?rev=229505&root=gcc&view=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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
2015-05-08 7:41 [Bug c/66068] New: error: type variant has different TYPE_VFIELD dcb314 at hotmail dot com
` (7 preceding siblings ...)
2015-10-28 20:02 ` wilson at gcc dot gnu.org
@ 2015-10-28 20:06 ` wilson at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: wilson at gcc dot gnu.org @ 2015-10-28 20:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068
Jim Wilson <wilson at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Jim Wilson <wilson at gcc dot gnu.org> ---
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.
^ permalink raw reply [flat|nested] 10+ messages in thread