[Bug c++/70515] Nested lambdas causing invalid captured pointers on some platforms

2017-03-17 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70515

--- Comment #5 from Norgg  ---
Created attachment 40994
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40994=edit
gcc -v output for gcc 6.2.0

[Bug c++/70515] Nested lambdas causing invalid captured pointers on some platforms

2017-03-17 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70515

Norgg  changed:

   What|Removed |Added

 CC||gcc at norgg dot org

--- Comment #4 from Norgg  ---
Created attachment 40993
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40993=edit
gcc -v output for gcc 5.4.0

(In reply to Martin Sebor from comment #3)
> I also cannot reproduce it with 7.0 on powepc64le or with 5.x on x86_64. 
> Can you please list the processor architectures you see this problem on? 
> (Providing the output of gcc -v should help.)

I can still reproduce this on my x86_64 Ubuntu system, in both g++ 5.4.1 and
6.2.0, gcc -v output from each attached.

[Bug c++/70515] Nested lambdas causing invalid captured pointers on some platforms

2016-04-02 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70515

--- Comment #1 from Norgg  ---
Created attachment 38164
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38164=edit
Preprocessed file

[Bug c++/70515] New: Nested lambdas causing invalid captured pointers on some platforms

2016-04-02 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70515

Bug ID: 70515
   Summary: Nested lambdas causing invalid captured pointers on
some platforms
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at norgg dot org
  Target Milestone: ---

Created attachment 38163
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38163=edit
Minimal testcase

The attached code causes a segfault at runtime due to an invalid read when
trying to dereference j on some platforms but not others across multiple
versions of GCC.

We can replicate this on various machines with:

Ubuntu g++ 5.3.1 / 5.1.1 / 4.8.4
Gentoo g++ 5.3.0

But not on:

OSX g++ 5.3.0 / 6.0.0
Debian g++ 5.3.1

The command line used to compile and run was: 

g++ -std=c++11 lambdabug.cpp -o lambdabug && ./lambdabug

[Bug c++/67699] New: Segfault compiling a constexpr array with -fmerge-all-constants -flto

2015-09-23 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699

Bug ID: 67699
   Summary: Segfault compiling a constexpr array with
-fmerge-all-constants -flto
   Product: gcc
   Version: 5.2.1
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc at norgg dot org
  Target Milestone: ---

Created attachment 36380
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36380=edit
Minimal testcase

Minimal test case attached, run with: g++ -std=c++11 -fmerge-all-constants
-flto gcc_crash.cpp -o gcc_crash.o

We've found this is repeatable in:

g++ (Ubuntu 4.9.2-0ubuntu1~14.04) 4.9.2
g++ (Ubuntu 5.1.0-0ubuntu11~14.04.1) 5.1.0
g++ 5.2.1 20150825 (Ubuntu 5.2.1-15ubuntu5)
g++ (Debian 5.2.1-17) 5.2.1 20150911
g++.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 5.1.0


[Bug c++/67699] Segfault compiling a constexpr array with -fmerge-all-constants -flto

2015-09-23 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699

--- Comment #2 from Norgg  ---
It seems the -fmerge-all-constants isn't necessary to cause the segfault either
any more, although it was in an earlier larger test case.

Minimal command line to reproduce is now:
$ g++ const_crash.cpp -flto
const_crash.cpp:11:24: internal compiler error: Segmentation fault
 template class foo;
^


[Bug c++/67699] Segfault compiling a constexpr array with -fmerge-all-constants -flto

2015-09-23 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699

--- Comment #1 from Norgg  ---
Created attachment 36381
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36381=edit
Reduced testcase with const instead of constexpr

Futher testing by slowriot found that you can change the constexpr to const and
drop the --std switch.


[Bug c++/67699] Segfault compiling a const array with -flto

2015-09-23 Thread gcc at norgg dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699

--- Comment #3 from Norgg  ---
Created attachment 36382
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36382=edit
Preprocessed file