Bug 82849 - [8 Regression] ICE on valid code since r254379
Summary: [8 Regression] ICE on valid code since r254379
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2017-11-05 17:31 UTC by Martin Liška
Modified: 2017-12-16 16:01 UTC (History)
3 users (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2017-11-05 17:31:21 UTC
We divide by zero here:

  1425        if (single_exit (loop)->count () > profile_count::zero ())
  1426          trip_count = latch_edge->count ().to_gcov_type ()
  1427                       / single_exit (loop)->count ().to_gcov_type ();

$ ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/eoshift_5.f90  -O2 -fmodulo-sched
during RTL pass: sms
/home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/eoshift_5.f90:182:0:

 end program main
 
internal compiler error: Floating point exception
0xc0fd1f crash_signal
	../../gcc/toplev.c:324
0x143b536 sms_schedule
	../../gcc/modulo-sched.c:1426
0x143cd6f execute
	../../gcc/modulo-sched.c:3342
Comment 1 Andrew Pinski 2017-11-05 19:47:12 UTC
What target is this on?
Comment 2 Andrey Guskov 2017-11-06 10:40:24 UTC
r254379 also triggers this make check failure:

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/ /source/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c -B/work/x86_64-pc-linux-gnu/./libmpx/ -B/work/x86_64-pc-linux-gnu/./libmpx/mpxrt -L/work/x86_64-pc-linux-gnu/./libmpx/mpxrt/.libs -B/work/x86_64-pc-linux-gnu/./libmpx/ -B/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap -L/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap/.libs -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -fdump-tree-optimized -S -o vrp101.s
PASS: gcc.dg/tree-ssa/vrp101.c (test for excess errors)
FAIL: gcc.dg/tree-ssa/vrp101.c scan-tree-dump optimized "<bb 2> \\[[0-9.]+%\\] \\[count: [0-9INV]*\\]:[\n\r ]*return 0;"

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared --enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl --enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell
Comment 3 Jan Hubicka 2017-11-19 14:46:46 UTC
Patch posted.
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01668.html
Comment 4 Jakub Jelinek 2017-12-11 17:44:37 UTC
Honza, what happened to this patch?  My understanding is that Jeff approved it, but it hasn't been committed.
Comment 5 Jeffrey A. Law 2017-12-16 16:01:47 UTC
I went ahead and committed Jan's patch to the trunk.
Comment 6 Jeffrey A. Law 2017-12-16 16:01:58 UTC
Author: law
Date: Sat Dec 16 16:01:26 2017
New Revision: 255748

URL: https://gcc.gnu.org/viewcvs?rev=255748&root=gcc&view=rev
Log:
2017-12-16  Jan Hubicka  <hubicka@ucw.cz>

	PR rtl-optimization/82849
	* modulo-sched.c (sms_schedule): Use get_estimated_loop_iterations_int
	and get_max_loop_iterations_int.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/modulo-sched.c