public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53094] New: vector literal
@ 2012-04-23 20:14 marc.glisse at normalesup dot org
  2012-11-26 23:18 ` [Bug c++/53094] " glisse at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-23 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53094
           Summary: vector literal
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marc.glisse@normalesup.org


Hello,

VECTOR_TYPE should be a literal type in C++11, so we can have for instance:
constexpr __m128i v = { 1, 0 };
constexpr __m128i s = v + v;

Once PR c++/51033 is fixed, ideally, the following would also work:
constexpr long long i = v[1];
constexpr __m128i w = __builtin_shuffle (m, m);

but I guess this can be made in several steps as long as the compiler doesn't
ICE on those.


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

* [Bug c++/53094] vector literal
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
@ 2012-11-26 23:18 ` glisse at gcc dot gnu.org
  2012-11-28 17:26 ` glisse at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-26 23:18 UTC (permalink / raw)
  To: gcc-bugs


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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glisse at gcc dot gnu.org

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-26 23:17:49 UTC ---
Vectors have become literals some time ago, but most constexpr code using them
fails. Turning vector CONSTRUCTOR into VECTOR_CST in fold (next to ARRAY_REF
handling) looks like a good first step.


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

* [Bug c++/53094] vector literal
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
  2012-11-26 23:18 ` [Bug c++/53094] " glisse at gcc dot gnu.org
@ 2012-11-28 17:26 ` glisse at gcc dot gnu.org
  2012-11-28 21:11 ` glisse at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-28 17:26 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-28 17:25:51 UTC ---
Created attachment 28820
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28820
Incomplete patch

Slightly ridiculous: with this patch, v+v still fails because we don't manage
to fold a NOP_EXPR that casts a VECTOR_CST from V2DI to const V2DI...


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

* [Bug c++/53094] vector literal
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
  2012-11-26 23:18 ` [Bug c++/53094] " glisse at gcc dot gnu.org
  2012-11-28 17:26 ` glisse at gcc dot gnu.org
@ 2012-11-28 21:11 ` glisse at gcc dot gnu.org
  2012-11-28 21:53 ` glisse at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-28 21:11 UTC (permalink / raw)
  To: gcc-bugs


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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28820|0                           |1
        is obsolete|                            |

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-28 21:11:44 UTC ---
Created attachment 28822
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28822
patch

addition and shuffle compile with this patch, but not [] yet.


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

* [Bug c++/53094] vector literal
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  2012-11-28 21:11 ` glisse at gcc dot gnu.org
@ 2012-11-28 21:53 ` glisse at gcc dot gnu.org
  2012-11-29 15:40 ` glisse at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-28 21:53 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-28 21:52:54 UTC ---
Handling subscripts will be harder. Currently, v[1] is turned into ((const
long*)&v)[1]. But (const long*)&v doesn't work as a constant expression. So we
would need to change the way vector subscripts are handled in
cp_build_array_ref to let the front-end generate a BIT_FIELD_REF directly.


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

* [Bug c++/53094] vector literal
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  2012-11-28 21:53 ` glisse at gcc dot gnu.org
@ 2012-11-29 15:40 ` glisse at gcc dot gnu.org
  2012-11-29 15:45 ` [Bug c++/53094] constexpr vector subscripting glisse at gcc dot gnu.org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-29 15:40 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-29 15:40:27 UTC ---
Author: glisse
Date: Thu Nov 29 15:40:16 2012
New Revision: 193938

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193938
Log:
2012-11-29  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/53094
gcc/
    * fold-const.c (fold): Replace a CONSTRUCTOR with a VECTOR_CST.
gcc/cp/
    * cvt.c (ocp_convert): Call convert_to_vector.
gcc/testsuite/
    * g++.dg/ext/vector20.C: New testcase.


Added:
    trunk/gcc/testsuite/g++.dg/ext/vector20.C   (with props)
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cvt.c
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog

Propchange: trunk/gcc/testsuite/g++.dg/ext/vector20.C
            ('svn:eol-style' added)

Propchange: trunk/gcc/testsuite/g++.dg/ext/vector20.C
            ('svn:keywords' added)


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (4 preceding siblings ...)
  2012-11-29 15:40 ` glisse at gcc dot gnu.org
@ 2012-11-29 15:45 ` glisse at gcc dot gnu.org
  2012-12-03 14:30 ` vincenzo.innocente at cern dot ch
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-29 15:45 UTC (permalink / raw)
  To: gcc-bugs


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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|vector literal              |constexpr vector
                   |                            |subscripting

--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-29 15:44:57 UTC ---
Renaming to highlight the main remaining issue.


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (5 preceding siblings ...)
  2012-11-29 15:45 ` [Bug c++/53094] constexpr vector subscripting glisse at gcc dot gnu.org
@ 2012-12-03 14:30 ` vincenzo.innocente at cern dot ch
  2012-12-03 14:54 ` glisse at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-12-03 14:30 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-12-03 14:29:54 UTC ---
a bit of cross posting with PR55573] sorry

this

typedef float __attribute__( ( vector_size( 4*sizeof(float) ) ) ) V4;
constexpr V4 build(float x,float y, float z) { return (V4){x,y,z,0};}
constexpr V4 x = build(1,0,0);

produces

c++ -std=c++11 -Ofast -c ceVec.cc 
ceVec.cc:3:29: error: ‘(const V4)V4{1.0e+0f, 0.0f, 0.0f, 0.0f}’ is not a
constant expression
 constexpr V4 x = build(1,0,0);


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (6 preceding siblings ...)
  2012-12-03 14:30 ` vincenzo.innocente at cern dot ch
@ 2012-12-03 14:54 ` glisse at gcc dot gnu.org
  2012-12-03 19:15 ` vincenzo.innocente at cern dot ch
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-12-03 14:54 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-03 14:53:52 UTC ---
(In reply to comment #7)
> typedef float __attribute__( ( vector_size( 4*sizeof(float) ) ) ) V4;
> constexpr V4 build(float x,float y, float z) { return (V4){x,y,z,0};}
> constexpr V4 x = build(1,0,0);
> 
> produces
> 
> c++ -std=c++11 -Ofast -c ceVec.cc 
> ceVec.cc:3:29: error: ‘(const V4)V4{1.0e+0f, 0.0f, 0.0f, 0.0f}’ is not a
> constant expression
>  constexpr V4 x = build(1,0,0);

cxx_eval_bare_aggregate returns build_constructor(...). Adding:

if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
  t = fold (t);

might help.


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (7 preceding siblings ...)
  2012-12-03 14:54 ` glisse at gcc dot gnu.org
@ 2012-12-03 19:15 ` vincenzo.innocente at cern dot ch
  2012-12-03 19:53 ` glisse at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-12-03 19:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #9 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-12-03 19:15:09 UTC ---
adding  it "helps"
   t = build_constructor (TREE_TYPE (t), n);
+  if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
+    t = fold (t);
   TREE_CONSTANT (t) = true;

unfortunately generates ICE for the class constructor at cp/tree.c:2712


struct Rot3 {
  typedef float T;
  typedef V4 Vec;
  Vec  axis[3];
  constexpr Rot3( V4 ix,  V4 iy,  V4 iz) :
    axis{ix,iy,iz}{}

  constexpr Rot3(T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) :
    Rot3( (Vec){xx,xy,xz,0},
      (Vec){yx,yy,yz,0},
      (Vec){zx,zy,zz,0}
      ){}

};

constexpr Rot3 r2( (V4){0, 1 ,0,0}, (V4){0, 0, 1,0},(V4){1, 0, 0,0});
constexpr Rot3 r1( 0, 1 ,0, 0, 0, 1,  1, 0, 0);

ceVec.cc:26:46:   in constexpr expansion of ‘((Rot3*)(& r1))->Rot3::Rot3(0.0,
1.0e+0, 0.0, 0.0, 0.0, 1.0e+0, 1.0e+0, 0.0, 0.0)’
ceVec.cc:21:4:   in constexpr expansion of
‘((Rot3*)this)->Rot3::Rot3(Rot3::Vec{xx, xy, xz, 0.0f}, Rot3::Vec{yx, yy, yz,
0.0f}, Rot3::Vec{zx, zy, zz, 0.0f})’
ceVec.cc:26:46: internal compiler error: in cp_tree_equal, at cp/tree.c:2712
 constexpr Rot3 r1( 0, 1 ,0, 0, 0, 1,  1, 0, 0);


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (8 preceding siblings ...)
  2012-12-03 19:15 ` vincenzo.innocente at cern dot ch
@ 2012-12-03 19:53 ` glisse at gcc dot gnu.org
  2012-12-03 21:58 ` vincenzo.innocente at cern dot ch
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-12-03 19:53 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #10 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-03 19:52:39 UTC ---
Created attachment 28864
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28864
minimal cumulative patch for comment #9

(In reply to comment #9)
> adding  it "helps"
>    t = build_constructor (TREE_TYPE (t), n);
> +  if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
> +    t = fold (t);
>    TREE_CONSTANT (t) = true;

I would have put it after TREE_CONSTANT, but that's not the problem.

> unfortunately generates ICE for the class constructor at cp/tree.c:2712

Indeed, cp_tree_equal is missing a VECTOR_CST case. We can likely just forward
to operand_equal_p.

With this patch (I am not proposing it, it conflicts with Jakub's), your last
code compiles.


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (9 preceding siblings ...)
  2012-12-03 19:53 ` glisse at gcc dot gnu.org
@ 2012-12-03 21:58 ` vincenzo.innocente at cern dot ch
  2012-12-03 22:05 ` vincenzo.innocente at cern dot ch
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-12-03 21:58 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #11 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-12-03 21:58:05 UTC ---
thanks Marc,
adding your proposed change above Jason's one make my full test works (but when
subscripting is involved..)
this is my current svn diff
Hope that c++ maintainers came make, out of all this, an optimal patch for the
trunk. 
I'm not expert enough on the details to judge what best (besides that I did not
run regression!)

Index: gcc/cp/tree.c
===================================================================
--- gcc/cp/tree.c    (revision 194084)
+++ gcc/cp/tree.c    (working copy)
@@ -2468,7 +2468,8 @@
     case COMPLEX_CST:
       return cp_tree_equal (TREE_REALPART (t1), TREE_REALPART (t2))
     && cp_tree_equal (TREE_IMAGPART (t1), TREE_IMAGPART (t2));
-
+    case VECTOR_CST:
+          return operand_equal_p (t1, t2, OEP_ONLY_CONST);    
     case CONSTRUCTOR:
       /* We need to do this when determining whether or not two
      non-type pointer to member function template arguments
Index: gcc/cp/semantics.c
===================================================================
--- gcc/cp/semantics.c    (revision 194084)
+++ gcc/cp/semantics.c    (working copy)
@@ -6451,6 +6451,14 @@
   /* Avoid wrapping an aggregate value in a NOP_EXPR.  */
   if (TREE_CODE (temp) == CONSTRUCTOR)
     return build_constructor (type, CONSTRUCTOR_ELTS (temp));
+  if (TREE_CODE (temp) == VECTOR_CST)
+    {
+      int i, count = TYPE_VECTOR_SUBPARTS (type);
+      tree *vec = XALLOCAVEC (tree, count);
+      for (i = 0; i < count; i++)
+    vec[i] = cp_fold_convert (TREE_TYPE (type), VECTOR_CST_ELT (temp, i));
+      return build_vector (type, vec);
+    }
   gcc_assert (SCALAR_TYPE_P (type));
   return cp_fold_convert (type, temp);
 }
@@ -7134,7 +7142,10 @@
       vec_free (n);
       return t;
     }
+
   t = build_constructor (TREE_TYPE (t), n);
+  if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
+    t = fold (t);
   TREE_CONSTANT (t) = true;
   return t;
 }


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (10 preceding siblings ...)
  2012-12-03 21:58 ` vincenzo.innocente at cern dot ch
@ 2012-12-03 22:05 ` vincenzo.innocente at cern dot ch
  2012-12-03 22:31 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-12-03 22:05 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #12 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-12-03 22:05:29 UTC ---
about subscripting I get an ICE (set fault)
with
constexpr V4 v = {1,1,1,0};
constexpr V4 m[3] = { (V4){1,0,0,0}, (V4){0,1,0,0}, (V4){0,0,1,0}};
constexpr V4 r = v[0]*m[0] +  v[1]*m[1] + v[2]*m[2];



constexpr V4 r = v[0]*m[0] +  v[1]*m[1] + v[2]*m[2];
                                                   ^

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
cxx_eval_constant_expression (call=0x0, t=0x1425961b0,
allow_non_constant=<value temporarily unavailable, due to optimizations>,
addr=<value temporarily unavailable, due to optimizations>,
non_constant_p=0x7fff5fbff31e, overflow_p=0x7fff5fbff31f) at
../.././gcc/cp/semantics.c:7122
7122          if (TREE_CODE (ce->index) == COMPONENT_REF)
(gdb) were
Undefined command: "were".  Try "help".
(gdb) where
#0  cxx_eval_constant_expression (call=0x0, t=0x1425961b0,
allow_non_constant=<value temporarily unavailable, due to optimizations>,
addr=<value temporarily unavailable, due to optimizations>,
non_constant_p=0x7fff5fbff31e, overflow_p=0x7fff5fbff31f) at
../.././gcc/cp/semantics.c:7122
#1  0x00000001001bdbb2 in cxx_eval_constant_expression (call=0x0, t=0x0,
allow_non_constant=<value temporarily unavailable, due to optimizations>,
addr=<value temporarily unavailable, due to optimizations>,
non_constant_p=0x14242fee8, overflow_p=0x14258dc40) at
../.././gcc/cp/semantics.c:6791


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (11 preceding siblings ...)
  2012-12-03 22:05 ` vincenzo.innocente at cern dot ch
@ 2012-12-03 22:31 ` glisse at gcc dot gnu.org
  2012-12-11 20:20 ` glisse at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-12-03 22:31 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-03 22:30:53 UTC ---
typedef float __attribute__( ( vector_size( 4*sizeof(float) ) ) ) V4;
constexpr V4 v = {1,1,1,0};
constexpr V4 r = v[0]+v;

is enough to reproduce your latest ICE. cxx_eval_bare_aggregate doesn't check
that ce->index is not NULL for the constructor elements, and tests its
TREE_CODE, which segfaults. Easiest workaround is to test if ce->index is zero
and in that case skip the COMPONENT_REF and NOP_EXPR tests. Which brings you
back to a regular "not a constant expression" error message.


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (12 preceding siblings ...)
  2012-12-03 22:31 ` glisse at gcc dot gnu.org
@ 2012-12-11 20:20 ` glisse at gcc dot gnu.org
  2013-07-09 16:02 ` glisse at gcc dot gnu.org
  2013-07-09 16:10 ` glisse at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-12-11 20:20 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #14 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-11 20:20:34 UTC ---
Author: glisse
Date: Tue Dec 11 20:20:23 2012
New Revision: 194421

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194421
Log:
2012-12-11  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/53094
cp/
    * tree.c (cp_tree_equal): Handle VECTOR_CST.
    * semantics.c (cxx_eval_bare_aggregate): Protect a dereference.
    Handle VECTOR_CST.
testsuite/
    * g++.dg/cpp0x/constexpr-53094-1.C: New testcase.
    * g++.dg/cpp0x/constexpr-53094-2.C: Likewise.
    * g++.dg/cpp0x/constexpr-53094-3.C: Likewise.


Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-1.C   (with props)
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C   (with props)
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-3.C   (with props)
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog

Propchange: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-1.C
            ('svn:eol-style' added)

Propchange: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-1.C
            ('svn:keywords' added)

Propchange: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C
            ('svn:eol-style' added)

Propchange: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C
            ('svn:keywords' added)

Propchange: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-3.C
            ('svn:eol-style' added)

Propchange: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-3.C
            ('svn:keywords' added)


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (13 preceding siblings ...)
  2012-12-11 20:20 ` glisse at gcc dot gnu.org
@ 2013-07-09 16:02 ` glisse at gcc dot gnu.org
  2013-07-09 16:10 ` glisse at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-07-09 16:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Marc Glisse <glisse at gcc dot gnu.org> ---
r200822 | glisse | 2013-07-09 17:58:36 +0200 (Tue, 09 Jul 2013) | 11 lines

2013-07-09  Marc Glisse  <marc.glisse@inria.fr>

        PR c++/53094
gcc/cp/
        * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.

gcc/testsuite/
        * g++.dg/cpp0x/constexpr-53094-1.C: Adjust.
        * g++.dg/ext/vector24.C: New testcase.


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

* [Bug c++/53094] constexpr vector subscripting
  2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
                   ` (14 preceding siblings ...)
  2013-07-09 16:02 ` glisse at gcc dot gnu.org
@ 2013-07-09 16:10 ` glisse at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-07-09 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |glisse at gcc dot gnu.org

--- Comment #16 from Marc Glisse <glisse at gcc dot gnu.org> ---
Fixed, I guess. Please open a new PR if there are other vector operations that
work in regular code but not in constexpr.


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

end of thread, other threads:[~2013-07-09 16:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-23 20:14 [Bug c++/53094] New: vector literal marc.glisse at normalesup dot org
2012-11-26 23:18 ` [Bug c++/53094] " glisse at gcc dot gnu.org
2012-11-28 17:26 ` glisse at gcc dot gnu.org
2012-11-28 21:11 ` glisse at gcc dot gnu.org
2012-11-28 21:53 ` glisse at gcc dot gnu.org
2012-11-29 15:40 ` glisse at gcc dot gnu.org
2012-11-29 15:45 ` [Bug c++/53094] constexpr vector subscripting glisse at gcc dot gnu.org
2012-12-03 14:30 ` vincenzo.innocente at cern dot ch
2012-12-03 14:54 ` glisse at gcc dot gnu.org
2012-12-03 19:15 ` vincenzo.innocente at cern dot ch
2012-12-03 19:53 ` glisse at gcc dot gnu.org
2012-12-03 21:58 ` vincenzo.innocente at cern dot ch
2012-12-03 22:05 ` vincenzo.innocente at cern dot ch
2012-12-03 22:31 ` glisse at gcc dot gnu.org
2012-12-11 20:20 ` glisse at gcc dot gnu.org
2013-07-09 16:02 ` glisse at gcc dot gnu.org
2013-07-09 16:10 ` glisse 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).