public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
@ 2008-01-16 20:30 ` tkoenig at gcc dot gnu dot org
  2008-01-16 21:49 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-16 20:30 UTC (permalink / raw)
  To: gcc-bugs



-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-16 20:03:03
               date|                            |


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


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

* [Bug fortran/34817]  New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
@ 2008-01-16 20:30 tkoenig at gcc dot gnu dot org
  2008-01-16 20:30 ` [Bug fortran/34817] " tkoenig at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-16 20:30 UTC (permalink / raw)
  To: gcc-bugs

Seems I missed a case in my patch for PR 34671:

program main
  real, dimension(2,2) :: a
  logical, dimension(2) :: b
  integer, dimension(2) :: i
  equivalence (b,i)
  data a /1.0, 2.0, -0.1, -0.2 /

  i = 16843009 ! Initialize i to put junk into b
  call random_number(a)
  b = any(a>0.5,dim=1)
  if (b(1) .or. .not. b(2)) print *,b

  i = 16843009  ! Initialize i to put junk into b
  b = all(a>0.5,dim=1)
  if (b(1) .or. .not. b(2)) print *,b
end program main

Here's a patch (untested, because I am currently
bootstrapping):

Index: iresolve.c
===================================================================
--- iresolve.c  (revision 131577)
+++ iresolve.c  (working copy)
@@ -247,7 +247,10 @@ gfc_resolve_dint (gfc_expr *f, gfc_expr 
 void
 gfc_resolve_all (gfc_expr *f, gfc_expr *mask, gfc_expr *dim)
 {
+  int kind;
+
   f->ts = mask->ts;
+  kind = mask->ts.kind;

   if (dim != NULL)
     {
@@ -260,7 +263,7 @@ gfc_resolve_all (gfc_expr *f, gfc_expr *

   f->value.function.name
     = gfc_get_string (PREFIX ("all_%c%d"), gfc_type_letter (mask->ts.type),
-                     mask->ts.kind);
+                     kind);
 }


@@ -297,7 +300,10 @@ gfc_resolve_dnint (gfc_expr *f, gfc_expr
 void
 gfc_resolve_any (gfc_expr *f, gfc_expr *mask, gfc_expr *dim)
 {
+  int kind;
+
   f->ts = mask->ts;
+  kind = mask->ts.kind;

   if (dim != NULL)
     {
@@ -310,7 +316,7 @@ gfc_resolve_any (gfc_expr *f, gfc_expr *

   f->value.function.name
     = gfc_get_string (PREFIX ("any_%c%d"), gfc_type_letter (mask->ts.type),
-                     mask->ts.kind);
+                     kind);
 }


-- 
           Summary: [4.3 regression] mixed-kind "any" and "all" intrinsics
                    with expressions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: tkoenig at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
  2008-01-16 20:30 ` [Bug fortran/34817] " tkoenig at gcc dot gnu dot org
@ 2008-01-16 21:49 ` rguenth at gcc dot gnu dot org
  2008-01-16 22:46 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-16 21:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Target Milestone|---                         |4.3.0


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


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

* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
  2008-01-16 20:30 ` [Bug fortran/34817] " tkoenig at gcc dot gnu dot org
  2008-01-16 21:49 ` rguenth at gcc dot gnu dot org
@ 2008-01-16 22:46 ` tkoenig at gcc dot gnu dot org
  2008-01-17 18:24 ` tkoenig at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-16 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tkoenig at gcc dot gnu dot org  2008-01-16 22:36 -------
Here's a real test case:

program main
  real, dimension(2,2) :: a
  logical(kind=4), dimension(2) :: b
  integer, dimension(2) :: i
  equivalence (b,i)
  data a /1.0, 2.0, -0.1, -0.2 /

  i = 16843009 ! Initialize i to put junk into b
  b = any(a>0.5,dim=1)
  if (b(2) .or. .not. b(1)) print *,b

  i = 16843009  ! Initialize i to put junk into b
  b = all(a>0.5,dim=1)
  if (b(2) .or. .not. b(1)) print *,b
end program main

This patch works:

Index: iresolve.c
===================================================================
--- iresolve.c  (revision 131577)
+++ iresolve.c  (working copy)
@@ -256,8 +256,6 @@ gfc_resolve_all (gfc_expr *f, gfc_expr *
       f->shape = gfc_copy_shape_excluding (mask->shape, mask->rank, dim);
     }

-  resolve_mask_arg (mask);
-
   f->value.function.name
     = gfc_get_string (PREFIX ("all_%c%d"), gfc_type_letter (mask->ts.type),
                      mask->ts.kind);
@@ -306,8 +304,6 @@ gfc_resolve_any (gfc_expr *f, gfc_expr *
       f->shape = gfc_copy_shape_excluding (mask->shape, mask->rank, dim);
     }

-  resolve_mask_arg (mask);
-
   f->value.function.name
     = gfc_get_string (PREFIX ("any_%c%d"), gfc_type_letter (mask->ts.type),
                      mask->ts.kind);


-- 


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


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

* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-01-16 22:46 ` tkoenig at gcc dot gnu dot org
@ 2008-01-17 18:24 ` tkoenig at gcc dot gnu dot org
  2008-01-19 18:36 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-17 18:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tkoenig at gcc dot gnu dot org  2008-01-17 18:18 -------
Because of a system problem, I won't be able
to commit this over the next few days.

If anybody wants to do this, be my guest.


-- 


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


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

* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-01-17 18:24 ` tkoenig at gcc dot gnu dot org
@ 2008-01-19 18:36 ` jakub at gcc dot gnu dot org
  2008-01-20  0:06 ` tkoenig at gcc dot gnu dot org
  2008-01-20  0:49 ` tkoenig at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-19 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-01-19 18:04 -------
Why is a Fortran FE bug considered P2?


-- 


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


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

* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-01-19 18:36 ` jakub at gcc dot gnu dot org
@ 2008-01-20  0:06 ` tkoenig at gcc dot gnu dot org
  2008-01-20  0:49 ` tkoenig at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-20  0:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tkoenig at gcc dot gnu dot org  2008-01-19 22:48 -------
Subject: Bug 34817

Author: tkoenig
Date: Sat Jan 19 22:47:47 2008
New Revision: 131660

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131660
Log:
2008-01-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/34817
        PR fortran/34838
        * iresolve.c (gfc_resolve_all):  Remove conversion of mask
        argument to kind=1 by removing call to resolve_mask_arg().
        (gfc_resolve_any):  Likewise.

2008-01-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/34817
        PR fortran/34838
        * gfortran.dg/any_all_1.f90:  New test.
        * gfortran.dg/any_all_2.f90:  New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/any_all_1.f90
    trunk/gcc/testsuite/gfortran.dg/any_all_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/iresolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
  2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-01-20  0:06 ` tkoenig at gcc dot gnu dot org
@ 2008-01-20  0:49 ` tkoenig at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-20  0:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tkoenig at gcc dot gnu dot org  2008-01-19 22:51 -------
Fixed.  Closing.


-- 

tkoenig at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-01-19 22:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-16 20:30 [Bug fortran/34817] New: [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions tkoenig at gcc dot gnu dot org
2008-01-16 20:30 ` [Bug fortran/34817] " tkoenig at gcc dot gnu dot org
2008-01-16 21:49 ` rguenth at gcc dot gnu dot org
2008-01-16 22:46 ` tkoenig at gcc dot gnu dot org
2008-01-17 18:24 ` tkoenig at gcc dot gnu dot org
2008-01-19 18:36 ` jakub at gcc dot gnu dot org
2008-01-20  0:06 ` tkoenig at gcc dot gnu dot org
2008-01-20  0:49 ` tkoenig 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).