public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50690] New: ICE with front end optimization and OMP workshare
@ 2011-10-10 19:14 tkoenig at gcc dot gnu.org
  2011-10-10 19:32 ` [Bug fortran/50690] [4.7 Regression] " burnus at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-10 19:14 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50690
           Summary: ICE with front end optimization and OMP workshare
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


>From http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50564#c8 :

Actually, I wonder in that case, how WORKSHARE will be handled, e.g.

implicit none
integer :: i
real :: A(5), B(5)
B(1) = 3.344
A = [real :: 1, 2, 3, 4, 5 ]
!$omp parallel default(shared)
!$omp workshare
A(:) = A(:)*cos(B(1))+A(:)*cos(B(1))
!$omp end workshare nowait
!$omp end parallel ! sync is implied here
print *, A
end


Answer: With -O, one gets an ICE:

omp.f90:7:0: internal compiler error: gfc_trans_omp_workshare(): Bad statement
code


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
@ 2011-10-10 19:32 ` burnus at gcc dot gnu.org
  2011-10-11 18:04 ` tkoenig at netcologne dot de
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-10 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |burnus at gcc dot gnu.org
   Target Milestone|---                         |4.7.0
            Summary|ICE with front end          |[4.7 Regression] ICE with
                   |optimization and OMP        |front end optimization and
                   |workshare                   |OMP workshare


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
  2011-10-10 19:32 ` [Bug fortran/50690] [4.7 Regression] " burnus at gcc dot gnu.org
@ 2011-10-11 18:04 ` tkoenig at netcologne dot de
  2011-10-11 18:34 ` burnus at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at netcologne dot de @ 2011-10-11 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from tkoenig at netcologne dot de <tkoenig at netcologne dot de> 2011-10-11 18:03:56 UTC ---
To me, the right strategy appears to be to mark the temporary
variable as threadprivate if we are within an OMP block.

Does this sound right?


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
  2011-10-10 19:32 ` [Bug fortran/50690] [4.7 Regression] " burnus at gcc dot gnu.org
  2011-10-11 18:04 ` tkoenig at netcologne dot de
@ 2011-10-11 18:34 ` burnus at gcc dot gnu.org
  2011-10-11 19:14 ` tkoenig at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-11 18:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-11 18:34:01 UTC ---
(In reply to comment #1)
> To me, the right strategy appears to be to mark the temporary
> variable as threadprivate if we are within an OMP block.

To me it sounds like the right solution to the wrong problem. The issue is that
WORKSHARE does not expect an EXPR_BLOCK. I think as long as there are only
work-share allowed items in EXPR_BLOCK, one can continue to translate the
OpenMP workshare as it - handling EXPR_BLOCK explicitly.

Independent of that, one should check whether one has to put the temporary in
thread-private memory. However, that applies then to all FE-optimization
temporaries as one never knows whether on is in a parallel block or not. It
might also affect other temporaries, gfortran generates. (Still, I was/am under
the impression that it is not needed in that case to mark such variable as
being thread local as they are just put on the stack. That's different for
static/external variables.)


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-10-11 18:34 ` burnus at gcc dot gnu.org
@ 2011-10-11 19:14 ` tkoenig at gcc dot gnu.org
  2011-10-11 19:25 ` tkoenig at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-11 19:14 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |tkoenig at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-10-11 19:13:43 UTC ---
Created attachment 25468
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25468
Proposed patch

This patch fixes the test case and passes regression testing.


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-10-11 19:14 ` tkoenig at gcc dot gnu.org
@ 2011-10-11 19:25 ` tkoenig at gcc dot gnu.org
  2011-10-11 19:54 ` tkoenig at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-11 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-10-11
     Ever Confirmed|0                           |1

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-10-11 19:24:38 UTC ---
(In reply to comment #3)
> Created attachment 25468 [details]
> Proposed patch
> 
> This patch fixes the test case and passes regression testing.

No it doesn't :-)


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-10-11 19:25 ` tkoenig at gcc dot gnu.org
@ 2011-10-11 19:54 ` tkoenig at gcc dot gnu.org
  2011-10-16 13:15 ` tkoenig at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-11 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-10-11 19:51:02 UTC ---
Created attachment 25470
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25470
A better patch

... because this one actually fixes the test case.


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-10-11 19:54 ` tkoenig at gcc dot gnu.org
@ 2011-10-16 13:15 ` tkoenig at gcc dot gnu.org
  2011-10-20 20:38 ` tkoenig at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-16 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|tkoenig at gcc dot gnu.org  |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-10-16 13:15:28 UTC ---
Patch at:

http://gcc.gnu.org/ml/gcc-patches/2011-10/msg01383.html

Unassigning myself.


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-10-16 13:15 ` tkoenig at gcc dot gnu.org
@ 2011-10-20 20:38 ` tkoenig at gcc dot gnu.org
  2011-10-22  8:11 ` tkoenig at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-20 20:38 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |tkoenig at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-10-20 20:38 ` tkoenig at gcc dot gnu.org
@ 2011-10-22  8:11 ` tkoenig at gcc dot gnu.org
  2011-10-27 10:39 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-22  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-10-22 08:10:45 UTC ---
Updated patch:

http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02003.html


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-10-22  8:11 ` tkoenig at gcc dot gnu.org
@ 2011-10-27 10:39 ` rguenth at gcc dot gnu.org
  2011-12-11 17:49 ` tkoenig at gcc dot gnu.org
  2011-12-11 19:46 ` tkoenig at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2011-10-27 10:39 ` rguenth at gcc dot gnu.org
@ 2011-12-11 17:49 ` tkoenig at gcc dot gnu.org
  2011-12-11 19:46 ` tkoenig at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-11 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 17:43:26 UTC ---
Author: tkoenig
Date: Sun Dec 11 17:43:22 2011
New Revision: 182208

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182208
Log:
2011-12-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/50690
    * frontend-passes.c (in_omp_workshare):  New variable.
    (cfe_expr_0):  Don't eliminiate common function if it would put
    the variable immediately into a WORKSHARE construct.
    (optimize_namespace):  Set in_omp_workshare.
    (gfc_code_walker):  Keep track of OMP PARALLEL and OMP WORKSHARE
    constructs.

2011-12-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/50690
    * gfortran.dg/gomp/workshare2.f90:  New test.
    * gfortran.dg/gomp/workshare3.f90:  New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/gomp/workshare2.f90
    trunk/gcc/testsuite/gfortran.dg/gomp/workshare3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/frontend-passes.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/50690] [4.7 Regression] ICE with front end optimization and OMP workshare
  2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2011-12-11 17:49 ` tkoenig at gcc dot gnu.org
@ 2011-12-11 19:46 ` tkoenig at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-11 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #9 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 17:48:40 UTC ---
Fixed (finally), closing.


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

end of thread, other threads:[~2011-12-11 17:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-10 19:14 [Bug fortran/50690] New: ICE with front end optimization and OMP workshare tkoenig at gcc dot gnu.org
2011-10-10 19:32 ` [Bug fortran/50690] [4.7 Regression] " burnus at gcc dot gnu.org
2011-10-11 18:04 ` tkoenig at netcologne dot de
2011-10-11 18:34 ` burnus at gcc dot gnu.org
2011-10-11 19:14 ` tkoenig at gcc dot gnu.org
2011-10-11 19:25 ` tkoenig at gcc dot gnu.org
2011-10-11 19:54 ` tkoenig at gcc dot gnu.org
2011-10-16 13:15 ` tkoenig at gcc dot gnu.org
2011-10-20 20:38 ` tkoenig at gcc dot gnu.org
2011-10-22  8:11 ` tkoenig at gcc dot gnu.org
2011-10-27 10:39 ` rguenth at gcc dot gnu.org
2011-12-11 17:49 ` tkoenig at gcc dot gnu.org
2011-12-11 19:46 ` tkoenig 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).