[Bug c++/70555] lambda capture of multi-dimensional VLA

2020-01-21 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555
Bug 70555 depends on bug 90740, which changed state.

Bug 90740 Summary: [9/10 Regression] VLA with lamba causes an incorrect 
unitialized in this function warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90740

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug c++/70555] lambda capture of multi-dimensional VLA

2018-09-20 Thread godmar at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555

--- Comment #11 from Godmar Back  ---
I have attached a test case where capture of multidimensional VLA results in 

internal compiler error: in expand_expr_real_1, at expr.c:9908

I do not know if this is a duplicate of this bug or a separate bug.
The program compiles and runs fine with clang 3.6.2, so I believe this should
be valid C++.

If this is a different bug and you'd like me to file a separate bug report, let
me know.

The behavior disappeared if the 'CC' array is no longer VLA.

[Bug c++/70555] lambda capture of multi-dimensional VLA

2018-09-20 Thread godmar at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555

Godmar Back  changed:

   What|Removed |Added

 CC||godmar at gmail dot com

--- Comment #10 from Godmar Back  ---
Created attachment 44730
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44730&action=edit
failing test

$ g++ dungeonpreprocessed.cpp 
dungeon.cpp: In lambda function:
dungeon.cpp:40:68: internal compiler error: in expand_expr_real_1, at
expr.c:9908
 auto neighbors = [L, R, C, &CC] (Point p) -> vector {
^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

[Bug c++/70555] lambda capture of multi-dimensional VLA

2018-04-09 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555

Jason Merrill  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #9 from Jason Merrill  ---
*** Bug 85256 has been marked as a duplicate of this bug. ***

[Bug c++/70555] lambda capture of multi-dimensional VLA

2018-04-09 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555

--- Comment #8 from Jason Merrill  ---
Bug 79627 is a case where we would need to do some capture in unevaluated
context, just as in C VLAs make sizeof non-constant.

[Bug c++/70555] lambda capture of multi-dimensional VLA

2018-04-09 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555

--- Comment #7 from Jason Merrill  ---
Created attachment 43886
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43886&action=edit
work in progress

Here's the beginning of work for more general variably-modified type capture,
based on the approach of capturing and remapping all the uses of outer
automatic vars in the VLA type when the VLA variable is captured.

Another approach would be to handle this later, when we actually do something
that involves the dimensions; that could avoid some unnecessary captures, but
currently the uses of the variable dimensions are hidden in ARRAY_REF, so we'd
need to lower it to pointer arithmetic in affected cases.

[Bug c++/70555] lambda capture of multi-dimensional VLA

2018-04-09 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555

Jason Merrill  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org
Summary|ICE in expand_expr_real_1   |lambda capture of
   |accessing a |multi-dimensional VLA
   |multi-dimensional VLA via   |
   |lambda-capture  |

--- Comment #6 from Jason Merrill  ---
Let's make this bug the primary one for implementation of more general
VLA/variably-modified type capture support.