[Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum

2014-01-30 Thread jason at gcc dot gnu.org
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


[Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum

2014-01-30 Thread jason at gcc dot gnu.org
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=207302root=gccview=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


[Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum

2014-01-07 Thread rguenth at gcc dot gnu.org
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


[Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum

2014-01-01 Thread glisse at gcc dot gnu.org
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).


[Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum

2013-12-30 Thread glisse at gcc dot gnu.org
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).


[Bug c++/59633] [4.7/4.8/4.9 Regression] ICE with __attribute((vector_size(...))) for enum

2013-12-30 Thread reichelt at gcc dot gnu.org
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.