public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor
@ 2013-02-06  4:44 radford at blackbean dot org
  2013-02-06  9:53 ` [Bug c++/56217] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: radford at blackbean dot org @ 2013-02-06  4:44 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56217
           Summary: ICE: OpenMP: when combining shared() and a move
                    constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: radford@blackbean.org


// ICE with shared(std::unique_ptr<> or equiv) when using: -fopenmp -std=c++11
-O1

template <typename T>
struct ptr {
    T *p;
    ptr() : p() {}
    ptr(ptr &) = delete;
    ptr(ptr &&o) : p(o) {}
    operator T *() { return p; }
};

static ptr<int> f()
{
    ptr<int> pt;
    #pragma omp task shared(pt)
    pt.p = 0;
    return pt;
}

int main(int c, char **v)
{
    #pragma omp parallel
    #pragma omp single    
    f();
}


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
@ 2013-02-06  9:53 ` rguenth at gcc dot gnu.org
  2013-02-06 10:35 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-06  9:53 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openmp
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-06
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-06 09:52:48 UTC ---
Confirmed.  On trunk we ICE with

t.C: In function 'ptr<int> f()':
t.C:15:15: error: invalid conversion in return statement
        return pt;
               ^
struct ptr

struct ptr &

return pt.5;

t.C:15:15: internal compiler error: verify_gimple failed
0xcfd441 verify_gimple_in_cfg(function*)
        /space/rguenther/src/svn/trunk/gcc/tree-cfg.c:4747


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
  2013-02-06  9:53 ` [Bug c++/56217] " rguenth at gcc dot gnu.org
@ 2013-02-06 10:35 ` jakub at gcc dot gnu.org
  2013-02-06 10:44 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-06 10:35 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-06 10:35:02 UTC ---
Author: jakub
Date: Wed Feb  6 10:34:53 2013
New Revision: 195796

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195796
Log:
    PR middle-end/56217
    * omp-low.c (use_pointer_for_field): Return false if
    lower_send_shared_vars doesn't generate any copy-out code.

    * g++.dg/gomp/pr56217.C: New test.

    * testsuite/libgomp.c++/pr56217.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr56217.C
    trunk/libgomp/testsuite/libgomp.c++/pr56217.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog
    trunk/libgomp/ChangeLog


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
  2013-02-06  9:53 ` [Bug c++/56217] " rguenth at gcc dot gnu.org
  2013-02-06 10:35 ` jakub at gcc dot gnu.org
@ 2013-02-06 10:44 ` jakub at gcc dot gnu.org
  2013-02-06 20:47 ` radford at blackbean dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-06 10:44 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-06 10:43:34 UTC ---
Should be fixed on the trunk so far.  Note your testcase is invalid, without
the taskwait I've added, it relies on NRV and even with NRV, by the time the
task can run the temporary result of f() can be destructed already.


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
                   ` (2 preceding siblings ...)
  2013-02-06 10:44 ` jakub at gcc dot gnu.org
@ 2013-02-06 20:47 ` radford at blackbean dot org
  2013-02-08 22:44 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: radford at blackbean dot org @ 2013-02-06 20:47 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jim Radford <radford at blackbean dot org> 2013-02-06 20:46:42 UTC ---
(In reply to comment #3)
> Should be fixed on the trunk

Thanks!

> Note your testcase is invalid, without
> the taskwait I've added, it relies on NRV and even with NRV, by the time the
> task can run the temporary result of f() can be destructed already.

I had the taskwait in my original.  Still, thanks for the explanation; it adds
to my nascent mental model of openmp.  Maybe one day I'll get something to
compile so I can try it out, but first I'm off to compile gcc!


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
                   ` (3 preceding siblings ...)
  2013-02-06 20:47 ` radford at blackbean dot org
@ 2013-02-08 22:44 ` paolo.carlini at oracle dot com
  2013-02-19 17:20 ` jakub at gcc dot gnu.org
  2013-02-19 17:38 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-08 22:44 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
                   ` (4 preceding siblings ...)
  2013-02-08 22:44 ` paolo.carlini at oracle dot com
@ 2013-02-19 17:20 ` jakub at gcc dot gnu.org
  2013-02-19 17:38 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-19 17:20 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-19 17:19:41 UTC ---
Author: jakub
Date: Tue Feb 19 17:19:36 2013
New Revision: 196141

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196141
Log:
    Backported from mainline
    2013-02-06  Jakub Jelinek  <jakub@redhat.com>

    PR middle-end/56217
    * omp-low.c (use_pointer_for_field): Return false if
    lower_send_shared_vars doesn't generate any copy-out code.

    * g++.dg/gomp/pr56217.C: New test.

    * testsuite/libgomp.c++/pr56217.C: New test.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/gomp/pr56217.C
    branches/gcc-4_7-branch/libgomp/testsuite/libgomp.c++/pr56217.C
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/omp-low.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_7-branch/libgomp/ChangeLog


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

* [Bug c++/56217] ICE: OpenMP: when combining shared() and a move constructor
  2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
                   ` (5 preceding siblings ...)
  2013-02-19 17:20 ` jakub at gcc dot gnu.org
@ 2013-02-19 17:38 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-19 17:38 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-19 17:38:02 UTC ---
Fixed for 4.7.3+.


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

end of thread, other threads:[~2013-02-19 17:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06  4:44 [Bug c++/56217] New: ICE: OpenMP: when combining shared() and a move constructor radford at blackbean dot org
2013-02-06  9:53 ` [Bug c++/56217] " rguenth at gcc dot gnu.org
2013-02-06 10:35 ` jakub at gcc dot gnu.org
2013-02-06 10:44 ` jakub at gcc dot gnu.org
2013-02-06 20:47 ` radford at blackbean dot org
2013-02-08 22:44 ` paolo.carlini at oracle dot com
2013-02-19 17:20 ` jakub at gcc dot gnu.org
2013-02-19 17:38 ` jakub 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).