public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/111811] [14 Regression] ICE with vector float bitfield after error
Date: Tue, 14 Nov 2023 08:07:23 +0000	[thread overview]
Message-ID: <bug-111811-4-Rnhi4DNpsR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111811-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 13 Nov 2023, joseph at codesourcery dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111811
> 
> --- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
> The checks are in check_bitfield_type_and_width.  I expect the attribute - 
> in this position a declaration attribute - gets applied after that (and 
> while applying it results in a change to the type, and thus in the 
> declaration being laid out again, this check doesn't get repeated).
> 
> In this case, the existing check is correct but not sufficient.  In 
> another case the check is arguably too early:
> 
> struct s { int __attribute__ ((__mode__ (DI))) x : 50; };
> 
> Considering int __attribute__ ((__mode__ (DI))) as a DImode integer type, 
> that bit-field width is valid - but it's rejected because the check is 
> carried out on int, before the attribute gets applied.  Getting that case 
> to work might require extracting early those declaration attributes that 
> actually affect the type, so they can be applied to the type before the 
> declaration gets constructed and such checks are carried out.

Ah, and when applying the vector_size attribute the FIELD_DECL hasn't been
updated to indicate we identified it as bitfield (so we could reject
the attribute) ...

I'll leave this to frontend folks to sort out.

  parent reply	other threads:[~2023-11-14  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-14 17:09 [Bug c/111811] New: gcc: internal compiler error: tree check: expected none of vector_type, have vector_type in finish_struct congli at smail dot nju.edu.cn
2023-11-12 22:09 ` [Bug c/111811] [14 Regression] ICE with vector float bitfield after error pinskia at gcc dot gnu.org
2023-11-12 22:13 ` pinskia at gcc dot gnu.org
2023-11-13  9:57 ` rguenth at gcc dot gnu.org
2023-11-13 23:24 ` joseph at codesourcery dot com
2023-11-14  8:07 ` rguenther at suse dot de [this message]
2024-01-15 13:54 ` rguenth at gcc dot gnu.org
2024-05-07  7:42 ` [Bug c/111811] [14/15 " rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111811-4-Rnhi4DNpsR@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).