public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/66133] New: Wrong-code with noreturn #pragma omp task body
@ 2015-05-13 11:43 jakub at gcc dot gnu.org
  2015-05-22  8:05 ` [Bug middle-end/66133] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-05-13 11:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66133

            Bug ID: 66133
           Summary: Wrong-code with noreturn #pragma omp task body
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: jakub at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

When working on #pragma omp taskloop support, I've noticed we handle badly
#pragma omp task constructs if the task's body never returns.

E.g.:

#include <stdlib.h>
#include <unistd.h>

volatile int x;

__attribute__((noinline)) void
foo (void)
{
  if (x == 0)
    {
      #pragma omp task
        {
          usleep (2000);
          exit (0);
        }
    }
  else
    abort ();
}

int
main ()
{
  #pragma omp parallel num_threads (1)
    {
      #pragma omp barrier
      #pragma omp single
        foo ();
    }
  exit (0);
}


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

* [Bug middle-end/66133] Wrong-code with noreturn #pragma omp task body
  2015-05-13 11:43 [Bug middle-end/66133] New: Wrong-code with noreturn #pragma omp task body jakub at gcc dot gnu.org
@ 2015-05-22  8:05 ` jakub at gcc dot gnu.org
  2015-06-03 15:35 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-05-22  8:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66133

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri May 22 08:04:41 2015
New Revision: 223520

URL: https://gcc.gnu.org/viewcvs?rev=223520&root=gcc&view=rev
Log:
        Backported from mainline
        2015-05-13  Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/66133
        * omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion,
        make sure it is never noreturn, even when the task body does not
        return.
        (lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE
        right before GIMPLE_OMP_RETURN.
        (make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont
        for GIMPLE_OMP_TASK.  For GIMPLE_OMP_RETURN corresponding to
        GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit.

        * testsuite/libgomp.c/pr66133.c: New test.

Added:
    branches/gcc-5-branch/libgomp/testsuite/libgomp.c/pr66133.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/omp-low.c
    branches/gcc-5-branch/libgomp/ChangeLog


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

* [Bug middle-end/66133] Wrong-code with noreturn #pragma omp task body
  2015-05-13 11:43 [Bug middle-end/66133] New: Wrong-code with noreturn #pragma omp task body jakub at gcc dot gnu.org
  2015-05-22  8:05 ` [Bug middle-end/66133] " jakub at gcc dot gnu.org
@ 2015-06-03 15:35 ` jakub at gcc dot gnu.org
  2015-06-03 21:37 ` jakub at gcc dot gnu.org
  2015-06-03 21:46 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-03 15:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66133

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun  3 15:35:03 2015
New Revision: 224093

URL: https://gcc.gnu.org/viewcvs?rev=224093&root=gcc&view=rev
Log:
        Backported from mainline
        2015-05-13  Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/66133
        * omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion,
        make sure it is never noreturn, even when the task body does not
        return.
        (lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE
        right before GIMPLE_OMP_RETURN.
        (make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont
        for GIMPLE_OMP_TASK.  For GIMPLE_OMP_RETURN corresponding to
        GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit.

        * testsuite/libgomp.c/pr66133.c: New test.

Added:
    branches/gcc-4_9-branch/libgomp/testsuite/libgomp.c/pr66133.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/omp-low.c
    branches/gcc-4_9-branch/libgomp/ChangeLog


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

* [Bug middle-end/66133] Wrong-code with noreturn #pragma omp task body
  2015-05-13 11:43 [Bug middle-end/66133] New: Wrong-code with noreturn #pragma omp task body jakub at gcc dot gnu.org
  2015-05-22  8:05 ` [Bug middle-end/66133] " jakub at gcc dot gnu.org
  2015-06-03 15:35 ` jakub at gcc dot gnu.org
@ 2015-06-03 21:37 ` jakub at gcc dot gnu.org
  2015-06-03 21:46 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-03 21:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66133

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun  3 21:36:26 2015
New Revision: 224105

URL: https://gcc.gnu.org/viewcvs?rev=224105&root=gcc&view=rev
Log:
        Backported from mainline
        2015-05-13  Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/66133
        * omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion,
        make sure it is never noreturn, even when the task body does not
        return.
        (lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE
        right before GIMPLE_OMP_RETURN.
        * tree-cfg.c (make_edges): Accept GIMPLE_OMP_CONTINUE as ->cont
        for GIMPLE_OMP_TASK.  For GIMPLE_OMP_RETURN corresponding to
        GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit.

        * testsuite/libgomp.c/pr66133.c: New test.

Added:
    branches/gcc-4_8-branch/libgomp/testsuite/libgomp.c/pr66133.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/omp-low.c
    branches/gcc-4_8-branch/gcc/tree-cfg.c
    branches/gcc-4_8-branch/libgomp/ChangeLog


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

* [Bug middle-end/66133] Wrong-code with noreturn #pragma omp task body
  2015-05-13 11:43 [Bug middle-end/66133] New: Wrong-code with noreturn #pragma omp task body jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-06-03 21:37 ` jakub at gcc dot gnu.org
@ 2015-06-03 21:46 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-03 21:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66133

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

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-06-03 21:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 11:43 [Bug middle-end/66133] New: Wrong-code with noreturn #pragma omp task body jakub at gcc dot gnu.org
2015-05-22  8:05 ` [Bug middle-end/66133] " jakub at gcc dot gnu.org
2015-06-03 15:35 ` jakub at gcc dot gnu.org
2015-06-03 21:37 ` jakub at gcc dot gnu.org
2015-06-03 21:46 ` 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).