public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/108910] [12/13 Regression] Further ICE in aarch64_layout_arg
Date: Fri, 10 Mar 2023 16:09:38 +0000	[thread overview]
Message-ID: <bug-108910-4-wn5wSMKT5f@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108910-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
To be exact, it is more complicated than that.
Some types with extra types are created using build_variant_type_copy and so
their TYPE_MAIN_VARIANT is without the attributes.
Example is handle_aligned_attribute -> common_handle_aligned_attribute ->
build_variant_type_copy.
Others are created as build_distinct_type_copy and don't have TYPE_MAIN_VARIANT
without it, e.g. build_type_attribute_variant ->
build_type_attribute_qual_variant -> build_distinct_type_copy.

Compare e.g. the #c0 testcase vs.
extern void foo (float, float *, float *);

void
bar (void *p)
{
  typedef float *FP;
  typedef FP FP2 __attribute__((aligned (64)));
  FP2 q = __builtin_assume_aligned (p, 64);
  foo (0.0f, q, q);
}
which doesn't ICE.
#0  build_distinct_type_copy (type=<pointer_type 0x7fffea274a80>) at
../../gcc/tree.cc:5693
#1  0x0000000000c143bb in build_type_attribute_qual_variant
(otype=<pointer_type 0x7fffea274a80>, attribute=<tree_list 0x7fffea2728c0>,
quals=0) at ../../gcc/attribs.cc:1298
#2  0x0000000000c156f0 in build_type_attribute_variant (ttype=<pointer_type
0x7fffea274a80>, attribute=<tree_list 0x7fffea2728c0>) at
../../gcc/attribs.cc:1591
#3  0x0000000000c13465 in decl_attributes (node=0x7fffffffd1f8,
attributes=<tree_list 0x7fffea272898>, flags=1, last_decl=<tree 0x0>) at
../../gcc/attribs.cc:964
#4  0x0000000000c32a69 in grokdeclarator (declarator=0x3716e40,
declspecs=0x3716cc0, decl_context=NORMAL, initialized=true, width=0x0,
decl_attrs=0x7fffffffd3d0, 
    expr=0x7fffffffd3f0, expr_const_operands=0x7fffffffd1ef,
deprecated_state=DEPRECATED_NORMAL) at ../../gcc/c/c-decl.cc:6967
#5  0x0000000000c2d270 in start_decl (declarator=0x3716e70,
declspecs=0x3716cc0, initialized=true, attributes=<tree 0x0>, do_push=true,
lastloc=0x0) at ../../gcc/c/c-decl.cc:5364
on #c0 while this one:
#1  0x000000000191494b in build_variant_type_copy (type=<pointer_type
0x7fffea274a80 FP>) at ../../gcc/tree.cc:5727
#2  0x0000000000dbaeba in common_handle_aligned_attribute (node=0x7fffffffd270,
name=<identifier_node 0x7fffea288dc0 aligned>, args=<tree_list 0x7fffea272848>,
flags=0, 
    no_add_attrs=0x7fffffffd28f, warn_if_not_aligned_p=false) at
../../gcc/c-family/c-attribs.cc:2386
#3  0x0000000000dbb633 in handle_aligned_attribute (node=0x7fffffffd270,
name=<identifier_node 0x7fffea288dc0 aligned>, args=<tree_list 0x7fffea272848>,
flags=0, 
    no_add_attrs=0x7fffffffd28f) at ../../gcc/c-family/c-attribs.cc:2499
#4  0x0000000000c12dcd in decl_attributes (node=0x7fffffffd3f8,
attributes=<tree_list 0x7fffea272898>, flags=0, last_decl=<tree 0x0>) at
../../gcc/attribs.cc:878
#5  0x0000000000c2d1bc in c_decl_attributes (node=0x7fffffffd3f8,
attributes=<tree_list 0x7fffea272898>, flags=0) at ../../gcc/c/c-decl.cc:5323
#6  0x0000000000c2d699 in start_decl (declarator=0x3716f60,
declspecs=0x3716ea0, initialized=false, attributes=<tree_list 0x7fffea272898>,
do_push=true, lastloc=0x7fffffffd584)
    at ../../gcc/c/c-decl.cc:5460

  parent reply	other threads:[~2023-03-10 16:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 20:56 [Bug target/108910] New: [13 " jakub at gcc dot gnu.org
2023-02-23 20:56 ` [Bug target/108910] " jakub at gcc dot gnu.org
2023-02-23 21:01 ` pinskia at gcc dot gnu.org
2023-02-23 21:03 ` [Bug target/108910] [12/13 " pinskia at gcc dot gnu.org
2023-02-23 21:09 ` jakub at gcc dot gnu.org
2023-02-23 21:55 ` jakub at gcc dot gnu.org
2023-02-27 13:05 ` jakub at gcc dot gnu.org
2023-02-28 16:47 ` clyon at gcc dot gnu.org
2023-03-01  9:00 ` cvs-commit at gcc dot gnu.org
2023-03-01  9:04 ` jakub at gcc dot gnu.org
2023-03-10 15:10 ` clyon at gcc dot gnu.org
2023-03-10 15:14 ` jakub at gcc dot gnu.org
2023-03-10 16:09 ` jakub at gcc dot gnu.org [this message]
2023-03-19  5:29 ` cvs-commit at gcc dot gnu.org
2023-04-03 14:06 ` jakub at gcc dot gnu.org
2023-04-13 15:58 ` cvs-commit at gcc dot gnu.org
2023-04-13 15:58 ` [Bug target/108910] [12 " rsandifo at gcc dot gnu.org
2023-04-14  7:12 ` schwab@linux-m68k.org
2023-04-14  8:24 ` rguenth at gcc dot gnu.org
2023-04-14 18:19 ` ebotcazou at gcc dot gnu.org
2023-04-14 20:51 ` jason at gcc dot gnu.org
2023-04-17 13:41 ` cvs-commit at gcc dot gnu.org
2023-04-17 13:43 ` rsandifo 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-108910-4-wn5wSMKT5f@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).