public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/101877] New: [s390x] ICE: canonical types differ for identical types when #pragma GCC target enables vector support
@ 2021-08-12 12:35 mhillen at linux dot ibm.com
  2021-08-18 14:16 ` [Bug other/101877] " mhillen at linux dot ibm.com
  2021-08-20 15:22 ` [Bug target/101877] " mhillen at linux dot ibm.com
  0 siblings, 2 replies; 3+ messages in thread
From: mhillen at linux dot ibm.com @ 2021-08-12 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101877
           Summary: [s390x] ICE: canonical types differ for identical
                    types when #pragma GCC target enables vector support
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mhillen at linux dot ibm.com
  Target Milestone: ---

When compiling C++ code on s390x where the command line arguments select an
architecture level without vectorization support (e.g., -march=zEC12) but a
#pragma GCC target upgrades to an architecture level with -mvx (e.g., pragma
GCC target("arch=z13,vx") ), I observed the following ICE:

Example code:
#include <vecintrin.h>

#pragma GCC target("arch=z13,vx")

typedef unsigned long long v2di __attribute__((vector_size(16)));

v2di bar() {
    v2di v = vec_splat_u64(0);
    return v;
}

g++ -march=zEC12 -c ~/pragma-vec2.cc 
/home/mhillen/pragma-vec2.cc: In function ‘v2di bar()’:
/home/mhillen/pragma-vec2.cc:9:29: internal compiler error: canonical types
differ for identical types ‘v2di’ {aka ‘__vector(2) long long unsigned int’}
and ‘__vector(2) long long unsigned int’
    9 |     v2di v = vec_splat_u64(0);
      |                             ^
0x155da39 comptypes(tree_node*, tree_node*, int)
        ../../gcc/cp/typeck.c:1558
0x12b58dd ocp_convert(tree_node*, tree_node*, int, int, int)
        ../../gcc/cp/cvt.c:749
0x12b7fdf convert(tree_node*, tree_node*)
        ../../gcc/cp/cvt.c:1683
0x15778ed convert_for_assignment
        ../../gcc/cp/typeck.c:9480
0x1578581 convert_for_initialization(tree_node*, tree_node*, tree_node*, int,
impl_conv_rhs, tree_node*, int, int)
        ../../gcc/cp/typeck.c:9722
0x1582407 digest_init_r
        ../../gcc/cp/typeck2.c:1251
0x15853a9 digest_init_flags(tree_node*, tree_node*, int, int)
        ../../gcc/cp/typeck2.c:1267
0x15853a9 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/cp/typeck2.c:742
0x12d4a23 check_initializer
        ../../gcc/cp/decl.c:7185
0x1308b57 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/cp/decl.c:8119
0x144af25 cp_parser_init_declarator
        ../../gcc/cp/parser.c:22556
0x141cef5 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:15088
0x141f261 cp_parser_declaration_statement
        ../../gcc/cp/parser.c:14182
0x141fb5f cp_parser_statement
        ../../gcc/cp/parser.c:12273
0x1420bbf cp_parser_statement_seq_opt
        ../../gcc/cp/parser.c:12679
0x1420d33 cp_parser_compound_statement
        ../../gcc/cp/parser.c:12628
0x14490c5 cp_parser_function_body
        ../../gcc/cp/parser.c:24762
0x14490c5 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.c:24813
0x1449f05 cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.c:30898
0x144b34f cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.c:30814
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


Likely related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101876

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

* [Bug other/101877] [s390x] ICE: canonical types differ for identical types when #pragma GCC target enables vector support
  2021-08-12 12:35 [Bug other/101877] New: [s390x] ICE: canonical types differ for identical types when #pragma GCC target enables vector support mhillen at linux dot ibm.com
@ 2021-08-18 14:16 ` mhillen at linux dot ibm.com
  2021-08-20 15:22 ` [Bug target/101877] " mhillen at linux dot ibm.com
  1 sibling, 0 replies; 3+ messages in thread
From: mhillen at linux dot ibm.com @ 2021-08-18 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Marius Hillenbrand <mhillen at linux dot ibm.com> ---
After narrowing down what triggers this bug, it is most likely a duplicate of 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101876

when the pragma sets 'vx' before the typedef, then the resulting type
definition appears broken. when enabling 'vx' only after the typedef, then the
example compiles successfully.

extended example -- causes ICE with -DBROKEN:

#include <vecintrin.h>

#ifdef BROKEN
#pragma GCC target("arch=z13,no-vx")
#else
#pragma GCC target("arch=z13,vx")
#endif

typedef unsigned long long v2di __attribute__((vector_size(16)));

#pragma GCC target("arch=z13,vx")

v2di bar() {
    v2di v = vec_splat_u64(0);
    return v;
}

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

* [Bug target/101877] [s390x] ICE: canonical types differ for identical types when #pragma GCC target enables vector support
  2021-08-12 12:35 [Bug other/101877] New: [s390x] ICE: canonical types differ for identical types when #pragma GCC target enables vector support mhillen at linux dot ibm.com
  2021-08-18 14:16 ` [Bug other/101877] " mhillen at linux dot ibm.com
@ 2021-08-20 15:22 ` mhillen at linux dot ibm.com
  1 sibling, 0 replies; 3+ messages in thread
From: mhillen at linux dot ibm.com @ 2021-08-20 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

Marius Hillenbrand <mhillen at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Marius Hillenbrand <mhillen at linux dot ibm.com> ---
Debugging confirmed that this is a duplicate of 101876. Closing this bug in
favor of the former.

*** This bug has been marked as a duplicate of bug 101876 ***

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

end of thread, other threads:[~2021-08-20 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 12:35 [Bug other/101877] New: [s390x] ICE: canonical types differ for identical types when #pragma GCC target enables vector support mhillen at linux dot ibm.com
2021-08-18 14:16 ` [Bug other/101877] " mhillen at linux dot ibm.com
2021-08-20 15:22 ` [Bug target/101877] " mhillen at linux dot ibm.com

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).