public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields
@ 2024-01-18 20:14 zsojka at seznam dot cz
  2024-01-19  9:16 ` [Bug c/113492] " rguenth at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-18 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113492
           Summary: [14 Regression] ICE: in composite_type_internal, at
                    c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 57147
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57147&action=edit
reduced testcase (from gcc.dg/c23-tag-composite-3.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -std=c2x -funsigned-bitfields testcase.c 
testcase.c: In function 'foo':
testcase.c:11:3: internal compiler error: in composite_type_internal, at
c/c-typeck.cc:557
   11 |   1 ? a : c;
      |   ^
0x6eabe7 composite_type_internal(tree_node*, tree_node*, composite_cache*)
        /repo/gcc-trunk/gcc/c/c-typeck.cc:557
0xe267e0 composite_type(tree_node*, tree_node*)
        /repo/gcc-trunk/gcc/c/c-typeck.cc:748
0xe267e0 build_conditional_expr(unsigned int, tree_node*, bool, tree_node*,
tree_node*, unsigned int, tree_node*, tree_node*, unsigned int)
        /repo/gcc-trunk/gcc/c/c-typeck.cc:5733
0xe59a26 c_parser_conditional_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:9238
0xe59d64 c_parser_expr_no_commas
        /repo/gcc-trunk/gcc/c/c-parser.cc:9072
0xe5a1c1 c_parser_expression
        /repo/gcc-trunk/gcc/c/c-parser.cc:12762
0xe5a697 c_parser_expression_conv
        /repo/gcc-trunk/gcc/c/c-parser.cc:12802
0xe7c5ef c_parser_statement_after_labels
        /repo/gcc-trunk/gcc/c/c-parser.cc:7761
0xe516c6 c_parser_compound_statement_nostart
        /repo/gcc-trunk/gcc/c/c-parser.cc:7248
0xe78d44 c_parser_compound_statement
        /repo/gcc-trunk/gcc/c/c-parser.cc:6533
0xe7b058 c_parser_declaration_or_fndef
        /repo/gcc-trunk/gcc/c/c-parser.cc:3017
0xe84c9b c_parser_external_declaration
        /repo/gcc-trunk/gcc/c/c-parser.cc:2046
0xe85683 c_parser_translation_unit
        /repo/gcc-trunk/gcc/c/c-parser.cc:1900
0xe85683 c_parse_file()
        /repo/gcc-trunk/gcc/c/c-parser.cc:26815
0xefb1b1 c_common_parse_file()
        /repo/gcc-trunk/gcc/c-family/c-opts.cc:1301
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

I would even say that with -funsigned-bitfields, the code is valid, but I am
not a language lawyer.
gcc-13, or gcc-14 without -std=2x, rejects the code though. On the other hand,
changing the "unsigned" to "signed", makes the code to be accepted, with the
default "signed" bitfields, so "int" and "signed" bitfield types are equal;
maybe my understanding of the "-funsigned-bitfields" as "any plain 'int'
bitfield is 'unsigned'" is incorrect.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240118 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
@ 2024-01-19  9:16 ` rguenth at gcc dot gnu.org
  2024-01-19 16:04 ` [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808 jakub at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-19  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
  2024-01-19  9:16 ` [Bug c/113492] " rguenth at gcc dot gnu.org
@ 2024-01-19 16:04 ` jakub at gcc dot gnu.org
  2024-01-19 18:10 ` uecker at gcc dot gnu.org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-19 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-19
                 CC|                            |jakub at gcc dot gnu.org
           Priority|P3                          |P1
            Summary|[14 Regression] ICE: in     |[14 Regression] ICE: in
                   |composite_type_internal, at |composite_type_internal, at
                   |c/c-typeck.cc:557 with      |c/c-typeck.cc:557 with
                   |-std=c2x                    |-std=c2x
                   |-funsigned-bitfields        |-funsigned-bitfields since
                   |                            |r14-6808

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r14-6808-g8c8d4b565cd7e08c6ec9ca5a4369d8ec5619cad8

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
  2024-01-19  9:16 ` [Bug c/113492] " rguenth at gcc dot gnu.org
  2024-01-19 16:04 ` [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808 jakub at gcc dot gnu.org
@ 2024-01-19 18:10 ` uecker at gcc dot gnu.org
  2024-01-20  6:15 ` zsojka at seznam dot cz
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-19 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

uecker at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uecker at gcc dot gnu.org

--- Comment #2 from uecker at gcc dot gnu.org ---


I agree that "int:3" with -funsigned-bitfields should produce a type which is
compatible to one  with "unsigned:3" and that forming a composite type has to
work.

I am not entirely sure this should be considered a regression as this C23
feature did not exist before (but was rejected and did not ICE).  Anyway, I
will look at this and post a patch. Thanks for reporting.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-01-19 18:10 ` uecker at gcc dot gnu.org
@ 2024-01-20  6:15 ` zsojka at seznam dot cz
  2024-01-20  8:30 ` uecker at gcc dot gnu.org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-20  6:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Zdenek Sojka <zsojka at seznam dot cz> ---
(In reply to uecker from comment #2)
> 
> I agree that "int:3" with -funsigned-bitfields should produce a type which
> is compatible to one  with "unsigned:3" and that forming a composite type
> has to work.
> 
> I am not entirely sure this should be considered a regression as this C23
> feature did not exist before (but was rejected and did not ICE).  Anyway, I
> will look at this and post a patch. Thanks for reporting.

Thank you for having a look.

The "regression" part is for the ICEing.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2024-01-20  6:15 ` zsojka at seznam dot cz
@ 2024-01-20  8:30 ` uecker at gcc dot gnu.org
  2024-01-20  8:39 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-20  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from uecker at gcc dot gnu.org ---

Yes, it is just weird because similar bugs for other new language features,
e.g. an ICE for BitInt are not labeled as a regression and are P3.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2024-01-20  8:30 ` uecker at gcc dot gnu.org
@ 2024-01-20  8:39 ` pinskia at gcc dot gnu.org
  2024-01-20  8:48 ` uecker at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to uecker from comment #4)
> Yes, it is just weird because similar bugs for other new language features,
> e.g. an ICE for BitInt are not labeled as a regression and are P3.

-std=c2x is not a "new feature" in GCC 14 though, it was there in GCC 13. What
is a new feature is "constructing composite types for structs and unions" but
those rules might not be known by many users so it is only new feature
internally.

Also P3 just means not categorized yet; I forgot where that is documented.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2024-01-20  8:39 ` pinskia at gcc dot gnu.org
@ 2024-01-20  8:48 ` uecker at gcc dot gnu.org
  2024-01-20  9:08 ` [Bug c/113492] " zsojka at seznam dot cz
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-20  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from uecker at gcc dot gnu.org ---

The point is that no existing code is broken by this because it was rejected
previously and now this only affects very new C23 code using bit-fields in
different structs that a declared in different ways and then only when using
together -funsigned-bitfields. So it is an obscure corner case of an obscure
corner case... 

But I will fix it anyway, soon I was just wondering why many similar bugs have
a different rating... If this is just because nobody came around to categorize
it, this makes sense.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2024-01-20  8:48 ` uecker at gcc dot gnu.org
@ 2024-01-20  9:08 ` zsojka at seznam dot cz
  2024-01-20  9:11 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-20  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

Zdenek Sojka <zsojka at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[14 Regression] ICE: in     |ICE: in
                   |composite_type_internal, at |composite_type_internal, at
                   |c/c-typeck.cc:557 with      |c/c-typeck.cc:557 with
                   |-std=c2x                    |-std=c2x
                   |-funsigned-bitfields since  |-funsigned-bitfields since
                   |r14-6808                    |r14-6808

--- Comment #7 from Zdenek Sojka <zsojka at seznam dot cz> ---
I am sorry for any confusion. I was not aware of the change between gcc-13 and
gcc-14 that this code should be accepted now.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2024-01-20  9:08 ` [Bug c/113492] " zsojka at seznam dot cz
@ 2024-01-20  9:11 ` pinskia at gcc dot gnu.org
  2024-01-20  9:15 ` uecker at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note it is an user visible regression. We have had this kind of discussion
before when we go from rejects to ICE without an error. I know I can dig up
some discussions about that.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2024-01-20  9:11 ` pinskia at gcc dot gnu.org
@ 2024-01-20  9:15 ` uecker at gcc dot gnu.org
  2024-01-20 12:34 ` uecker at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-20  9:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from uecker at gcc dot gnu.org ---
No need to dig it up, I believe you. I was just wondering.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (9 preceding siblings ...)
  2024-01-20  9:15 ` uecker at gcc dot gnu.org
@ 2024-01-20 12:34 ` uecker at gcc dot gnu.org
  2024-01-20 15:02 ` uecker at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-20 12:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from uecker at gcc dot gnu.org ---
Removing the assertion is enough to fix it. But the cause is strange. We
somehow get two unsigned types in DECL_BIT_FIELD_TYPE which should be the same
but are not, e.g:

 <integer_type 0x7f6dad774738 public unsigned SI
    size <integer_cst 0x7f6dad624198 type <integer_type 0x7f6dad6220a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x7f6dad6241b0 type <integer_type 0x7f6dad622000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f6dad774738 precision:32 min <integer_cst 0x7f6dad77ebe8 0> max <integer_cst
0x7f6dad769270 4294967295>>
 <integer_type 0x7f6dad622690 unsigned int public unsigned SI
    size <integer_cst 0x7f6dad624198 type <integer_type 0x7f6dad6220a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x7f6dad6241b0 type <integer_type 0x7f6dad622000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f6dad622690 precision:32 min <integer_cst 0x7f6dad6241c8 0> max <integer_cst
0x7f6dad624180 4294967295>
    pointer_to_this <pointer_type 0x7f6dad632690>>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (10 preceding siblings ...)
  2024-01-20 12:34 ` uecker at gcc dot gnu.org
@ 2024-01-20 15:02 ` uecker at gcc dot gnu.org
  2024-01-21 18:39 ` cvs-commit at gcc dot gnu.org
  2024-01-31 20:01 ` uecker at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-20 15:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from uecker at gcc dot gnu.org ---
Created attachment 57175
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57175&action=edit
patch


Untested patch.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (11 preceding siblings ...)
  2024-01-20 15:02 ` uecker at gcc dot gnu.org
@ 2024-01-21 18:39 ` cvs-commit at gcc dot gnu.org
  2024-01-31 20:01 ` uecker at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-21 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Uecker <uecker@gcc.gnu.org>:

https://gcc.gnu.org/g:1ead42f9836a13cbbe6a2be685f76750583ae320

commit r14-8316-g1ead42f9836a13cbbe6a2be685f76750583ae320
Author: Martin Uecker <uecker@tugraz.at>
Date:   Sat Jan 20 19:03:57 2024 +0100

    C23: Fix ICE for composite type for structs with unsigned bitfields
[PR113492]

    This patch fixes a bug when forming a composite type from structs that
    contain an unsigned bitfield declared with int while using
-funsigned-bitfields.
    In such structs the unsigned integer type was not compatible to the
    regular unsigned integer type used elsewhere in the C FE.

            PR c/113492
    gcc/c:
            * c-decl.cc (grokdeclarator): Use c_common_unsigned_type instead of
            unsigned_type_for to create the unsigned type for bitfields
declared
            with int when using -funsigned-bitfields.

    gcc/testsuite:
            * gcc.dg/pr113492.c: New test.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808
  2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
                   ` (12 preceding siblings ...)
  2024-01-21 18:39 ` cvs-commit at gcc dot gnu.org
@ 2024-01-31 20:01 ` uecker at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: uecker at gcc dot gnu.org @ 2024-01-31 20:01 UTC (permalink / raw)
  To: gcc-bugs

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

uecker at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #13 from uecker at gcc dot gnu.org ---
Fixed on trunk.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-01-31 20:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 20:14 [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields zsojka at seznam dot cz
2024-01-19  9:16 ` [Bug c/113492] " rguenth at gcc dot gnu.org
2024-01-19 16:04 ` [Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808 jakub at gcc dot gnu.org
2024-01-19 18:10 ` uecker at gcc dot gnu.org
2024-01-20  6:15 ` zsojka at seznam dot cz
2024-01-20  8:30 ` uecker at gcc dot gnu.org
2024-01-20  8:39 ` pinskia at gcc dot gnu.org
2024-01-20  8:48 ` uecker at gcc dot gnu.org
2024-01-20  9:08 ` [Bug c/113492] " zsojka at seznam dot cz
2024-01-20  9:11 ` pinskia at gcc dot gnu.org
2024-01-20  9:15 ` uecker at gcc dot gnu.org
2024-01-20 12:34 ` uecker at gcc dot gnu.org
2024-01-20 15:02 ` uecker at gcc dot gnu.org
2024-01-21 18:39 ` cvs-commit at gcc dot gnu.org
2024-01-31 20:01 ` uecker at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).