public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/30143]  New: OpenMP can produce invalid gimple
@ 2006-12-11  0:19 pinskia at gcc dot gnu dot org
  2006-12-11  0:21 ` [Bug middle-end/30143] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-11  0:19 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
int f (int n)
{
  int i;
#pragma omp parallel
    for (i = 1; i < n - 1; ++i)
      ;
}

------
We get:
.omp_data_iD.1661->iD.1662 = D.1669 + 1;

Which is obvious invalid gimple.
The patch in PR 30142 was used to find this.


-- 
           Summary: OpenMP can produce invalid gimple
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
OtherBugsDependingO 30142
             nThis:


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
@ 2006-12-11  0:21 ` pinskia at gcc dot gnu dot org
  2006-12-11  1:17 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-11  0:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-12-11 00:21 -------
Another testcase which shows the same issue:
int f (int n)
{
  int i;
#pragma omp parallel
    i++;
}


-- 


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
  2006-12-11  0:21 ` [Bug middle-end/30143] " pinskia at gcc dot gnu dot org
@ 2006-12-11  1:17 ` pinskia at gcc dot gnu dot org
  2006-12-11  1:32 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-11  1:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-12-11 01:17 -------
Note, tree-Nested does the correct thing.  This because it does:
          if (wi->val_only)
            {
              if (wi->is_lhs)
                x = save_tmp_var (info, x, &wi->tsi);
              else
                x = init_tmp_var (info, x, &wi->tsi);
            }

While OpenMP, just does:
  if (wi->is_lhs)
    gs = gimplify_expr (tp, &pre, NULL, is_gimple_lvalue, fb_lvalue);
  else if (wi->val_only)
    gs = gimplify_expr (tp, &pre, NULL, is_gimple_val, fb_rvalue);
  else
    gs = gimplify_expr (tp, &pre, NULL, is_gimple_formal_tmp_var, fb_rvalue);

And we just replace x with a->b instead of doing a full initialization. 


-- 


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
  2006-12-11  0:21 ` [Bug middle-end/30143] " pinskia at gcc dot gnu dot org
  2006-12-11  1:17 ` pinskia at gcc dot gnu dot org
@ 2006-12-11  1:32 ` pinskia at gcc dot gnu dot org
  2006-12-15  8:37 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-11  1:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-12-11 01:32 -------
I have a patch which makes openmp lowering, do the same thing as the nested
lowering does and it fixes the problem.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-11 01:32:42
               date|                            |


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-12-11  1:32 ` pinskia at gcc dot gnu dot org
@ 2006-12-15  8:37 ` pinskia at gcc dot gnu dot org
  2006-12-15 22:53 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-15  8:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-12-15 08:37 -------
I have a new fix which does not cause PR 30167 this time.


-- 


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-12-15  8:37 ` pinskia at gcc dot gnu dot org
@ 2006-12-15 22:53 ` pinskia at gcc dot gnu dot org
  2006-12-16  2:27 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-15 22:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-12-15 22:53 -------
Here is a testcase that fails without the verifier installed:
int f (int n)
{
  int i;
  _Complex float t;
#pragma omp parallel
    for (i = 1; i < n - 1; ++i)
      t+=1;
}


-- 


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-12-15 22:53 ` pinskia at gcc dot gnu dot org
@ 2006-12-16  2:27 ` pinskia at gcc dot gnu dot org
  2006-12-16  2:29 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-16  2:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-12-16 02:27 -------
Oh and I messed up somewhere still with my current patch, most likely forgot to
set DECL_GIMPLE_REG_P for the variable.


-- 


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-12-16  2:27 ` pinskia at gcc dot gnu dot org
@ 2006-12-16  2:29 ` pinskia at gcc dot gnu dot org
  2006-12-20 17:50 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-16  2:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-12-16 02:29 -------
(In reply to comment #6)
> Oh and I messed up somewhere still with my current patch, most likely forgot to
> set DECL_GIMPLE_REG_P for the variable.
Yep that what it was, I have a fix now.


-- 


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


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

* [Bug middle-end/30143] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-12-16  2:29 ` pinskia at gcc dot gnu dot org
@ 2006-12-20 17:50 ` pinskia at gcc dot gnu dot org
  2006-12-20 17:52 ` [Bug middle-end/30143] [4.2 only] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-20 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2006-12-20 17:50 -------
Subject: Bug 30143

Author: pinskia
Date: Wed Dec 20 17:50:17 2006
New Revision: 120080

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120080
Log:
2006-12-20  Andrew Pinski  <pinskia@gmail.com>

        PR middle-end/30143
        * omp-low.c (init_tmp_var): New function.
        (save_tmp_var): New function.
        (lower_omp_1): Use them for VAR_DECL.

2006-12-20  Andrew Pinski  <pinskia@gmail.com>

        PR middle-end/30143
        * gcc.dg/gomp/complex-1.c: New testcase.




Added:
    trunk/gcc/testsuite/gcc.dg/gomp/complex-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/30143] [4.2 only] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-12-20 17:50 ` pinskia at gcc dot gnu dot org
@ 2006-12-20 17:52 ` pinskia at gcc dot gnu dot org
  2006-12-29  8:43 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-20 17:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-12-20 17:52 -------
I will post a patch for 4.2 also.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|OpenMP can produce invalid  |[4.2 only] OpenMP can
                   |gimple                      |produce invalid gimple
   Target Milestone|---                         |4.2.0


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


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

* [Bug middle-end/30143] [4.2 only] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-12-20 17:52 ` [Bug middle-end/30143] [4.2 only] " pinskia at gcc dot gnu dot org
@ 2006-12-29  8:43 ` jakub at gcc dot gnu dot org
  2007-02-19 20:49 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-12-29  8:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2006-12-29 08:43 -------
4.2 version of the patch at
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01504.html


-- 


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


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

* [Bug middle-end/30143] [4.2 only] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-12-29  8:43 ` jakub at gcc dot gnu dot org
@ 2007-02-19 20:49 ` mmitchel at gcc dot gnu dot org
  2007-02-21  9:12 ` jakub at gcc dot gnu dot org
  2007-02-23 23:02 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-19 20:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from mmitchel at gcc dot gnu dot org  2007-02-19 20:49 -------
Jakub --

This patch is OK for 4.2 if tested there.

Thanks,

-- Mark


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu dot org
           Priority|P3                          |P2


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


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

* [Bug middle-end/30143] [4.2 only] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-02-19 20:49 ` mmitchel at gcc dot gnu dot org
@ 2007-02-21  9:12 ` jakub at gcc dot gnu dot org
  2007-02-23 23:02 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-02-21  9:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jakub at gcc dot gnu dot org  2007-02-21 09:12 -------
Subject: Bug 30143

Author: jakub
Date: Wed Feb 21 09:12:14 2007
New Revision: 122192

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122192
Log:
        Backported from mainline
        2006-12-20  Andrew Pinski  <pinskia@gmail.com>
        PR middle-end/30143
        * omp-low.c (init_tmp_var): New function.
        (save_tmp_var): New function.
        (lower_omp_1): Use them for VAR_DECL.

        * gcc.dg/gomp/complex-1.c: New testcase.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/gomp/complex-1.c
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/omp-low.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/30143] [4.2 only] OpenMP can produce invalid gimple
  2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2007-02-21  9:12 ` jakub at gcc dot gnu dot org
@ 2007-02-23 23:02 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-23 23:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pinskia at gcc dot gnu dot org  2007-02-23 23:01 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-02-23 23:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-11  0:19 [Bug middle-end/30143] New: OpenMP can produce invalid gimple pinskia at gcc dot gnu dot org
2006-12-11  0:21 ` [Bug middle-end/30143] " pinskia at gcc dot gnu dot org
2006-12-11  1:17 ` pinskia at gcc dot gnu dot org
2006-12-11  1:32 ` pinskia at gcc dot gnu dot org
2006-12-15  8:37 ` pinskia at gcc dot gnu dot org
2006-12-15 22:53 ` pinskia at gcc dot gnu dot org
2006-12-16  2:27 ` pinskia at gcc dot gnu dot org
2006-12-16  2:29 ` pinskia at gcc dot gnu dot org
2006-12-20 17:50 ` pinskia at gcc dot gnu dot org
2006-12-20 17:52 ` [Bug middle-end/30143] [4.2 only] " pinskia at gcc dot gnu dot org
2006-12-29  8:43 ` jakub at gcc dot gnu dot org
2007-02-19 20:49 ` mmitchel at gcc dot gnu dot org
2007-02-21  9:12 ` jakub at gcc dot gnu dot org
2007-02-23 23:02 ` pinskia at gcc dot gnu dot 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).