public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
@ 2013-12-30 14:29 reichelt at gcc dot gnu.org
  2013-12-30 15:09 ` [Bug c++/59633] " glisse at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-12-30 14:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

            Bug ID: 59633
           Summary: [4.7/4.8/4.9 Regression] ICE with
                    __attribute((vector_size(...))) for enum
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following valid code snippet triggers an ICE since GCC 4.4.0:

==============================================================
typedef enum { e } T __attribute__((vector_size(8)));

void foo(T t) {}
==============================================================


bug.cc:3:6: internal compiler error: Segmentation fault
 void foo(T t) {}
      ^
0xb75baf crash_signal
        ../../gcc/gcc/toplev.c:336
0x734388 decl_mangling_context
        ../../gcc/gcc/cp/mangle.c:755
0x73a143 write_name
        ../../gcc/gcc/cp/mangle.c:794
0x73de43 write_class_enum_type
        ../../gcc/gcc/cp/mangle.c:2509
0x73de43 write_type
        ../../gcc/gcc/cp/mangle.c:1976
0x73dc6c write_type
        ../../gcc/gcc/cp/mangle.c:2047
0x73f897 write_method_parms
        ../../gcc/gcc/cp/mangle.c:2496
0x73fb9c write_bare_function_type
        ../../gcc/gcc/cp/mangle.c:2438
0x743398 mangle_decl_string
        ../../gcc/gcc/cp/mangle.c:3433
0x743577 get_mangled_id
        ../../gcc/gcc/cp/mangle.c:3455
0x743577 mangle_decl(tree_node*)
        ../../gcc/gcc/cp/mangle.c:3478
0xd91200 decl_assembler_name(tree_node*)
        ../../gcc/gcc/tree.c:600
0xddccf1 make_decl_rtl(tree_node*)
        ../../gcc/gcc/varasm.c:1274
0xddd96d notice_global_symbol(tree_node*)
        ../../gcc/gcc/varasm.c:1548
0x859ed5 cgraph_finalize_function(tree_node*, bool)
        ../../gcc/gcc/cgraphunit.c:434
0x6feb1f expand_or_defer_fn(tree_node*)
        ../../gcc/gcc/cp/semantics.c:3981
0x693527 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22686
0x694394 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22590
0x694394 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16588
0x69562f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11200
Please submit a full bug report, [etc.]


The C-frontend compiles the code without issues.


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

* [Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
@ 2013-12-30 15:09 ` glisse at gcc dot gnu.org
  2013-12-30 21:27 ` reichelt at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-12-30 15:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
What makes you think the code is valid? From the doc, I think this should be
rejected (with a proper error message).


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

* [Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
  2013-12-30 15:09 ` [Bug c++/59633] " glisse at gcc dot gnu.org
@ 2013-12-30 21:27 ` reichelt at gcc dot gnu.org
  2014-01-01 12:09 ` glisse at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-12-30 21:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

--- Comment #2 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
> What makes you think the code is valid? From the doc, I think this should be
> rejected (with a proper error message).

Well, because the C-frontend compiles it, the C++-frontend used to compile it
and even clang (3.2) compiles it, I was under the impression that this should
compile (using the underlying type of the enum).

OTOH, bool is rejected, so enums could be rejected as well.
This would avoid the trouble of underlying types and (even more important)
the missing arithmetic operations.

About the docs: I'm not sure which docs you are referring to, but I don't
think the wording in gcc.info (6.49 Using Vector Instructions through Built-in
Functions) prohibits enums (it doesn't mention them explicitly):

> The `vector_size' attribute is only applicable to integral and float
> scalars, although arrays, pointers, and function return values are
> allowed in conjunction with this construct. Only sizes that are a power
> of two are currently allowed.

IMHO enums are integral scalars.

> All the basic integer types can be used as base types, both as signed
> and as unsigned: `char', `short', `int', `long', `long long'.  In
> addition, `float' and `double' can be used to build floating-point
> vector types.

It's not clear whether this list is exhaustive or not.
And of course, the docs are at least incomplete, if not inaccurate.
E.g. the vector extension of the ternary operator ?: is missing in this
chapter.


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

* [Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
  2013-12-30 15:09 ` [Bug c++/59633] " glisse at gcc dot gnu.org
  2013-12-30 21:27 ` reichelt at gcc dot gnu.org
@ 2014-01-01 12:09 ` glisse at gcc dot gnu.org
  2014-01-07 11:54 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-01-01 12:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Volker Reichelt from comment #2)
> Well, because the C-frontend compiles it, the C++-frontend used to compile
> it and even clang (3.2) compiles it, I was under the impression that this
> should compile (using the underlying type of the enum).

Ok, I'll let someone else decide what behavior is wanted.

> And of course, the docs are at least incomplete, if not inaccurate.
> E.g. the vector extension of the ternary operator ?: is missing in this
> chapter.

The doc for ?: is under review. If other parts are incomplete or inaccurate,
don't hesitate to file bugs (or even post doc patches).


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

* [Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-01-01 12:09 ` glisse at gcc dot gnu.org
@ 2014-01-07 11:54 ` rguenth at gcc dot gnu.org
  2014-01-30 14:06 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-07 11:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.4


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

* [Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-01-07 11:54 ` rguenth at gcc dot gnu.org
@ 2014-01-30 14:06 ` jason at gcc dot gnu.org
  2014-01-30 14:22 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-30 14:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-01-30
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
     Ever confirmed|0                           |1


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

* [Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-01-30 14:06 ` jason at gcc dot gnu.org
@ 2014-01-30 14:22 ` jason at gcc dot gnu.org
  2014-01-30 14:24 ` [Bug c++/59633] [4.7/4.8 " jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-30 14:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Jan 30 14:21:31 2014
New Revision: 207302

URL: http://gcc.gnu.org/viewcvs?rev=207302&root=gcc&view=rev
Log:
    PR c++/59633
gcc/
    * tree.c (walk_type_fields): Handle VECTOR_TYPE.
gcc/cp/
    * decl2.c (attributes_naming_typedef_ok): New.
    * cp-tree.h: Declare it.
    * decl.c (grokdeclarator): Check it.
    * tree.c (no_linkage_check): Handle VECTOR_TYPE.

Added:
    trunk/gcc/testsuite/g++.dg/ext/vector26.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/tree.c
    trunk/gcc/tree.c


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

* [Bug c++/59633] [4.7/4.8 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-01-30 14:22 ` jason at gcc dot gnu.org
@ 2014-01-30 14:24 ` jason at gcc dot gnu.org
  2014-06-12 13:45 ` rguenth at gcc dot gnu.org
  2014-08-01 18:47 ` [Bug c++/59633] [4.8 " jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-30 14:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.9.0
            Summary|[4.7/4.8/4.9 Regression]    |[4.7/4.8 Regression] ICE
                   |ICE with                    |with
                   |__attribute((vector_size(.. |__attribute((vector_size(..
                   |.))) for enum               |.))) for enum
      Known to fail|4.9.0                       |

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.9 so far.  Does anyone care about this on earlier releases?


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

* [Bug c++/59633] [4.7/4.8 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-01-30 14:24 ` [Bug c++/59633] [4.7/4.8 " jason at gcc dot gnu.org
@ 2014-06-12 13:45 ` rguenth at gcc dot gnu.org
  2014-08-01 18:47 ` [Bug c++/59633] [4.8 " jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-12 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.4                       |4.8.4

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
The 4.7 branch is being closed, moving target milestone to 4.8.4.


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

* [Bug c++/59633] [4.8 Regression] ICE with __attribute((vector_size(...))) for enum
  2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-06-12 13:45 ` rguenth at gcc dot gnu.org
@ 2014-08-01 18:47 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-08-01 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|4.8.4                       |4.9.0

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Apparently no one cares about fixing this in 4.8.


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

end of thread, other threads:[~2014-08-01 18:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-30 14:29 [Bug c++/59633] New: [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum reichelt at gcc dot gnu.org
2013-12-30 15:09 ` [Bug c++/59633] " glisse at gcc dot gnu.org
2013-12-30 21:27 ` reichelt at gcc dot gnu.org
2014-01-01 12:09 ` glisse at gcc dot gnu.org
2014-01-07 11:54 ` rguenth at gcc dot gnu.org
2014-01-30 14:06 ` jason at gcc dot gnu.org
2014-01-30 14:22 ` jason at gcc dot gnu.org
2014-01-30 14:24 ` [Bug c++/59633] [4.7/4.8 " jason at gcc dot gnu.org
2014-06-12 13:45 ` rguenth at gcc dot gnu.org
2014-08-01 18:47 ` [Bug c++/59633] [4.8 " jason 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).