public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure
@ 2005-07-16  9:46 tkoenig at gcc dot gnu dot org
  2005-07-16 13:59 ` [Bug middle-end/22509] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-07-16  9:46 UTC (permalink / raw)
  To: gcc-bugs

This fails with

$ gfortran -O3 -funroll-loops elemental.f90
$ ./a.out
Aborted

Slightly reduced:

$ cat elemental-reduced.f90
! Program to test elemental functions.
program test_elemental
   implicit none
   integer(kind = 4), dimension (2, 4) :: a
   integer(kind = 4), dimension (2, 4) :: b
   integer(kind = 8), dimension(2) :: c

   a = reshape ((/2, 3, 4, 5, 6, 7, 8, 9/), (/2, 4/))
   b = 0
   b(2, :) = e_fn (a(1, :), 1)
   if (any (b .ne. reshape ((/0, 1, 0, 3, 0, 5, 0, 7/), (/2, 4/)))) call abort
   a = e_fn (a(:, 4:1:-1), 1 + b)
   print '(8I4)',a
   if (any (a .ne. reshape ((/7, 7, 5, 3, 3, -1, 1, -5/), (/2, 4/)))) call abort

contains

elemental integer function e_fn (p, q)
   integer, intent(in) :: p, q
   e_fn = p - q
end function
end program
$ cat elemental-reduced.f90
! Program to test elemental functions.
program test_elemental
   implicit none
   integer(kind = 4), dimension (2, 4) :: a
   integer(kind = 4), dimension (2, 4) :: b
   integer(kind = 8), dimension(2) :: c

   a = reshape ((/2, 3, 4, 5, 6, 7, 8, 9/), (/2, 4/))
   b = 0
   b(2, :) = e_fn (a(1, :), 1)
   if (any (b .ne. reshape ((/0, 1, 0, 3, 0, 5, 0, 7/), (/2, 4/)))) call abort
   a = e_fn (a(:, 4:1:-1), 1 + b)
   print '(8I4)',a
   if (any (a .ne. reshape ((/7, 7, 5, 3, 3, -1, 1, -5/), (/2, 4/)))) call abort

contains

elemental integer function e_fn (p, q)
   integer, intent(in) :: p, q
   e_fn = p - q
end function
end program
$ gfortran elemental-reduced.f90 && ./a.out
   7   7   5   3   3  -1   1  -5
$ gfortran -O3 elemental-reduced.f90 && ./a.out
   7   7   5   3   3  -1   1  -5
$ gfortran -O3 -funroll-loops elemental-reduced.f90 && ./a.out
   7   7   5   3   4  -3   6  -1
Aborted

-- 
           Summary: [4.1 regression] elemental.f90 testsuite failure
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
@ 2005-07-16 13:59 ` pinskia at gcc dot gnu dot org
  2005-07-16 19:01 ` tkoenig at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-16 13:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-16 13:50 -------
What target is this on? x86_64-pc-linux-gnu?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.1.0


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
  2005-07-16 13:59 ` [Bug middle-end/22509] " pinskia at gcc dot gnu dot org
@ 2005-07-16 19:01 ` tkoenig at gcc dot gnu dot org
  2005-07-26 21:27 ` tkoenig at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-07-16 19:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-07-16 18:59 -------
(In reply to comment #1)
> What target is this on? x86_64-pc-linux-gnu?

i686-pc-linux-gnu.

-- 


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
  2005-07-16 13:59 ` [Bug middle-end/22509] " pinskia at gcc dot gnu dot org
  2005-07-16 19:01 ` tkoenig at gcc dot gnu dot org
@ 2005-07-26 21:27 ` tkoenig at gcc dot gnu dot org
  2005-07-28 17:21 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-07-26 21:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-07-26 21:24 -------
Also seen on http://gcc.gnu.org/ml/gcc-testresults/2005-07/msg01377.html
and http://gcc.gnu.org/ml/gcc-testresults/2005-07/msg01002.html (for
Cygwin).

Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
 GCC target triplet|                            |i686-pc-*
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-26 21:24:27
               date|                            |


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-07-26 21:27 ` tkoenig at gcc dot gnu dot org
@ 2005-07-28 17:21 ` fxcoudert at gcc dot gnu dot org
  2005-07-29 12:40 ` [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb) pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-07-28 17:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-07-28 17:17 -------
I see it too on i386-freebsd and i686-linux. Appeared between 20050713 and
20050714. But then, the pentium is not an architecture that is often used.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-07-26 21:24:27         |2005-07-28 17:17:08
               date|                            |


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb)
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-07-28 17:21 ` fxcoudert at gcc dot gnu dot org
@ 2005-07-29 12:40 ` pinskia at gcc dot gnu dot org
  2005-07-31 23:55 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-29 12:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-29 12:38 -------
This is a -fweb latent bug.  If you do -O3 -fweb -funroll-loops on the 4.0 branch it also fails.

I have a patch which seems to work around the bug but also causes cost model of address models to be 
different from the mainline and I don't know if it is a correct patch or not.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
            Summary|[4.1 regression]            |[4.1 regression]
                   |elemental.f90 testsuite     |elemental.f90 testsuite
                   |failure                     |failure (-fweb)


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb)
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-07-29 12:40 ` [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb) pinskia at gcc dot gnu dot org
@ 2005-07-31 23:55 ` steven at gcc dot gnu dot org
  2005-08-01  0:21 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-07-31 23:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-07-31 23:41 -------
This fails for me on AMD64 even with -fno-web. 
 
$ cat elemental-reduced.f90 
! Program to test elemental functions. 
program test_elemental 
   implicit none 
   integer, parameter :: N = 8 
   integer(kind = 4), dimension (N) :: a 
   integer(kind = 4), dimension (N) :: b 
   integer i 
 
   a = 2 
   b = e_fn (2, 0) 
 
   a = e_fn (a(N:1:-1), b) 
 
   do i = 1,N 
      if (a(i) /= 0) call abort 
   end do 
 
contains 
 
   elemental integer function e_fn (p, q) 
      implicit none 
      integer, intent(in) :: p, q 
      e_fn = p - q 
   end function 
 
end program 
$ gfortran -static elemental-reduced.f90 -O3 -funroll-loops 
$ ./a.out 
Aborted 
$ gfortran -static elemental-reduced.f90 -O3 -funroll-loops -fno-web 
$ ./a.out 
Aborted 
$ 
 

-- 


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


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

* [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb)
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-07-31 23:55 ` steven at gcc dot gnu dot org
@ 2005-08-01  0:21 ` steven at gcc dot gnu dot org
  2005-08-22  4:45 ` [Bug rtl-optimization/22509] " mmitchel at gcc dot gnu dot org
  2005-08-22  6:33 ` tkoenig at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-08-01  0:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-08-01 00:20 -------
Slightly smaller yet: 
 
program test_elemental 
   implicit none 
   integer, parameter :: N = 6 
   integer(kind = 4), dimension (N) :: a 
   integer(kind = 4), dimension (N) :: b 
 
   a = 2 
   b = e_fn (2, 0) 
 
   a = e_fn (a(N:1:-1), b) 
 
   if (a(6) /= 0) call abort 
 
contains 
 
   elemental integer function e_fn (p, q) 
      implicit none 
      integer, intent(in) :: p, q 
      e_fn = p - q 
   end function 
 
end program 
 
Fails with -O2 -funroll-loops. 
Also fails with -O2 -funroll-loops -fno-strict-aliasing. 
 
 
 

-- 


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


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

* [Bug rtl-optimization/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb)
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-08-01  0:21 ` steven at gcc dot gnu dot org
@ 2005-08-22  4:45 ` mmitchel at gcc dot gnu dot org
  2005-08-22  6:33 ` tkoenig at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-08-22  4:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2005-08-22 04:43 -------
Fortran is not release-critical; removing target milestone.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |---


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


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

* [Bug rtl-optimization/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb)
  2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-08-22  4:45 ` [Bug rtl-optimization/22509] " mmitchel at gcc dot gnu dot org
@ 2005-08-22  6:33 ` tkoenig at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-08-22  6:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-08-22 05:57 -------
My understanding is that this is not Fortran-specific, but
that Fortran happens to have a test case that exposes this
bug.  Has anybody constructed a C test case?

-- 


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


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

end of thread, other threads:[~2005-08-22  5:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-16  9:46 [Bug middle-end/22509] New: [4.1 regression] elemental.f90 testsuite failure tkoenig at gcc dot gnu dot org
2005-07-16 13:59 ` [Bug middle-end/22509] " pinskia at gcc dot gnu dot org
2005-07-16 19:01 ` tkoenig at gcc dot gnu dot org
2005-07-26 21:27 ` tkoenig at gcc dot gnu dot org
2005-07-28 17:21 ` fxcoudert at gcc dot gnu dot org
2005-07-29 12:40 ` [Bug middle-end/22509] [4.1 regression] elemental.f90 testsuite failure (-fweb) pinskia at gcc dot gnu dot org
2005-07-31 23:55 ` steven at gcc dot gnu dot org
2005-08-01  0:21 ` steven at gcc dot gnu dot org
2005-08-22  4:45 ` [Bug rtl-optimization/22509] " mmitchel at gcc dot gnu dot org
2005-08-22  6:33 ` 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).