Bug 54034 - [4.8 Regression] doduc benchmark from polyhedron 11 segfaults
Summary: [4.8 Regression] doduc benchmark from polyhedron 11 segfaults
Status: RESOLVED DUPLICATE of bug 43716
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-19 16:38 UTC by Uroš Bizjak
Modified: 2012-07-21 10:44 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
doduc benchmark (36.82 KB, application/x-bzip2)
2012-07-19 16:59 UTC, Uroš Bizjak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uroš Bizjak 2012-07-19 16:38:08 UTC
doduc benchmark from Polyhedron 11 benchmark suite segfaults when compile with -O3 -ffast-math for x86_64-pc-linux-gnu target:

gcc version 4.8.0 20120719 (experimental) [trunk revision 189664] (GCC) 

[uros@localhost source]$ ./a.out
 MAIN : FIN S00002
 MAIN : FIN S00001
 MAIN : FIN S00011
 MAIN : FIN S00022
 TEMPS =     33.00000000 , NITERA :          1
 TEMPS =     34.00031044 , NITERA :        186
 TEMPS =     35.00497388 , NITERA :        955
 TEMPS =     36.00007615 , NITERA :       1512
 TEMPS =     37.00012624 , NITERA :       1765
 TEMPS =     38.00060760 , NITERA :       2044
 TEMPS =     39.00312223 , NITERA :       2327
 TEMPS =     40.00168143 , NITERA :       2607
 TEMPS =     45.00187475 , NITERA :       4017
 TEMPS =     50.00261983 , NITERA :       5492
 TEMPS =     55.00263522 , NITERA :       6981
 TEMPS =     60.00087007 , NITERA :       8679

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F6627DD0FD7
#1  0x7F6627DD15A4
#2  0x3C02E3599F
#3  0x4040E8 in s00061_ at doduc.f90:568
#4  0x412AD3 in s00013_ at doduc.f90:1150
#5  0x41B9D4 in doduc at doduc.f90:182

The problem is with index to y array:

Program received signal SIGSEGV, Segmentation fault.
s00061 (i=7, hv=0.0050539815561751163, hvt=0, hvme=0, hvms=0, ynu=4.3611596409392313, re=-nan(0x8000000000000), 
    tfl=1773.5356631567458, dtfl=-nan(0x8000000000000), iopt=0) at doduc.f90:568
568           y1 = y(i1)
Missing separate debuginfos, use: debuginfo-install glibc-2.15-51.fc17.x86_64
(gdb) p i1
$1 = -2147483635
(gdb) bt
#0  s00061 (i=7, hv=0.0050539815561751163, hvt=0, hvme=0, hvms=0, ynu=4.3611596409392313, re=-nan(0x8000000000000), 
    tfl=1773.5356631567458, dtfl=-nan(0x8000000000000), iopt=0) at doduc.f90:568
#1  0x0000000000412ad4 in s00013 () at doduc.f90:1150
#2  0x000000000041b9d5 in doduc () at doduc.f90:182
#3  0x0000000000400b4d in main (argc=<optimized out>, argv=<optimized out>) at doduc.f90:199
#4  0x0000003c02e21735 in __libc_start_main () from /lib64/libc.so.6
#5  0x0000000000400b79 in _start ()
(gdb) 

Please also note that a strange runtime regression happened with this benchmark on 18th of July [1].

[1] http://gcc.opensuse.org/c++bench/polyhedron/polyhedron-summary.txt-2-0.html
Comment 1 Uroš Bizjak 2012-07-19 16:59:37 UTC
Created attachment 27834 [details]
doduc benchmark

The source says:

! There is no condition about using this freeware : however
! I would appreciate receiving any new result from you to enrich
! the benchmark report , which is also available freely on request .

So, I have attached the benchmark in all of its glory.
Comment 2 janus 2012-07-20 09:23:00 UTC
(In reply to comment #0)
> doduc benchmark from Polyhedron 11 benchmark suite segfaults when compile with
> -O3 -ffast-math for x86_64-pc-linux-gnu target:
> 
> gcc version 4.8.0 20120719 (experimental) [trunk revision 189664] (GCC) 

works for me with:

Target: x86_64-unknown-linux-gnu
gcc version 4.8.0 20120718 (experimental) [trunk revision 189608] (GCC)
Comment 3 Richard Biener 2012-07-20 09:34:28 UTC
Possibly a dup of 54031?
Comment 4 Uroš Bizjak 2012-07-20 15:29:32 UTC
(In reply to comment #3)
> Possibly a dup of 54031?

No, still fails with:

gcc version 4.8.0 20120720 (experimental) [trunk revision 189718] (GCC)

Janus, please try to run the executable under valgrind:

==2822== Memcheck, a memory error detector
==2822== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==2822== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==2822== Command: ./a.out
==2822== 
 MAIN : FIN S00002
 MAIN : FIN S00001
 MAIN : FIN S00011
 MAIN : FIN S00022
 TEMPS =     33.00000000 , NITERA :          1
 TEMPS =     34.00031044 , NITERA :        186
 TEMPS =     35.00497388 , NITERA :        955
 TEMPS =     36.00007615 , NITERA :       1512
 TEMPS =     37.00012624 , NITERA :       1765
 TEMPS =     38.00060760 , NITERA :       2044
 TEMPS =     39.00312223 , NITERA :       2327
 TEMPS =     40.00168143 , NITERA :       2607
 TEMPS =     45.00187475 , NITERA :       4017
 TEMPS =     50.00261983 , NITERA :       5492
 TEMPS =     55.00263522 , NITERA :       6981
 TEMPS =     60.00087007 , NITERA :       8679
==2822== Invalid read of size 8
==2822==    at 0x4040E8: s00061_ (doduc.f90:568)
==2822==    by 0x412AD3: s00013_ (doduc.f90:1150)
==2822==    by 0x41B9D4: MAIN__ (doduc.f90:182)
==2822==    by 0x400B4C: main (doduc.f90:199)
==2822==  Address 0x3fefff770 is not stack'd, malloc'd or (recently) free'd
==2822==
Comment 5 Dominique d'Humieres 2012-07-20 19:26:05 UTC
This works for me on x86_64-apple-darwin10 at revision 189718 even when the executable is run under valgrind. Nevertheless this remind me pr43716 which disappeared without being explicitely fixed.

If needed, I have the file doduc.f90 exploded in one file per function/subroutine, just let me know.
Comment 6 janus 2012-07-20 21:47:43 UTC
(In reply to comment #4)
> Janus, please try to run the executable under valgrind:

Sorry, I still can not reproduce it. Neither with valgrind, nor at later revisions (189690,189711).

Did you use any other flags except "-O3 -ffast-math" which you did not tell us?
Comment 7 Tobias Burnus 2012-07-21 06:32:48 UTC
(In reply to comment #6)
> Sorry, I still can not reproduce it. Neither with valgrind, nor at later
> revisions (189690,189711).
> Did you use any other flags except "-O3 -ffast-math" which you did not tell us?

I can reproduce it here with Rev. 189737; it also crashes without running valgrind.

It crashes (on x86-64 openSUSE Factory) with
  -O3 -ffast-math [-g]

It does not crash with either of the following added:
  -fno-fast-math
  -fno-inline-functions
  -fno-predictive-commoning
  -fno-tree-vectorize

  -fno-protect-parens  (implied by -Ofast)

Nor does it crash with:
  -O2 -ftree-vectorize -finline-functions -ffpredictive-commoning -ffast-math
  -m32 -O3 -ffast-math
Comment 8 Uroš Bizjak 2012-07-21 10:44:26 UTC
Dup of pr43716.

*** This bug has been marked as a duplicate of bug 43716 ***