[Bug c++/88853] ICE: verify_type failed (error: type variant differs by TYPE_PACKED) with -fpack-struct -g

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 26 15:31:14 GMT 2023


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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
I get something similar for this C code:

enum fmt_type parse_num_range(const enum fmt_type);
enum __attribute__((packed)) fmt_type {
  FMT_NUMBER_OF_FORMATS
} parse_number(const enum fmt_type) {}

$ /usr/bin/gcc -c -g bug877.c
$ ~/gcc/results/bin/gcc -c -g bug877.c
bug877.c: In function ‘parse_number’:
bug877.c:4:27: error: type variant differs by TYPE_PACKED
    4 | } parse_number(const enum fmt_type) {}
      |                           ^~~~~~~~
 <enumeral_type 0x7fc8f09b4348 fmt_type
    type <integer_type 0x7fc8f0821348 unsigned char public unsigned QI
        size <integer_cst 0x7fc8f0802e88 constant 8>

This error seems like a regression in gcc-13. 

The bug first appears sometime before 9b111debbfb79a0a.


More information about the Gcc-bugs mailing list