[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-02-07 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

--- Comment #9 from Pat Haugen  ---
(In reply to Andrey Belevantsev from comment #8)
> I will take a look.  The ICE is within the code that models the scheduling
> loop in order to get the proper insn ticks and everything for later MD
> processing (it is equivalent to always scheduling the next insn).  Either
> there is an issue in that loop that wasn't uncovered anywhere but powerpc or
> there is some subtlety in the powerpc cpu model that is triggered there.  It
> is not very pleasant to find out and fix usually so it will take time.

Thanks, appreciate that. I did find out the isssue is not very pleasant to
track down as you state.

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-02-07 Thread abel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

--- Comment #8 from Andrey Belevantsev  ---
(In reply to Pat Haugen from comment #7)
> Assuming this is a latent selective scheduling bug since I can reproduce
> with r243865 by adding -fsched-pressure --param sched-pressure-algorithm=2.
> Looking...

I will take a look.  The ICE is within the code that models the scheduling loop
in order to get the proper insn ticks and everything for later MD processing
(it is equivalent to always scheduling the next insn).  Either there is an
issue in that loop that wasn't uncovered anywhere but powerpc or there is some
subtlety in the powerpc cpu model that is triggered there.  It is not very
pleasant to find out and fix usually so it will take time.

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-30 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

--- Comment #7 from Pat Haugen  ---
Assuming this is a latent selective scheduling bug since I can reproduce with
r243865 by adding -fsched-pressure --param sched-pressure-algorithm=2.
Looking...

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-29 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Aldy Hernandez  changed:

   What|Removed |Added

 CC||pthaugen at gcc dot gnu.org

--- Comment #6 from Aldy Hernandez  ---
Started with r243866.

commit 11082703aaa77f9d9587937d006a572cd7a1066a
Author: pthaugen 
Date:   Wed Dec 21 19:15:32 2016 +

PR rtl-optimization/11488
* common/config/rs6000/rs6000-common.c
(rs6000_option_optimization_table): Enable -fsched-pressure.
* config/rs6000/rs6000.c (TARGET_COMPUTE_PRESSURE_CLASSES): Define
target hook.
(rs6000_option_override_internal): Set default -fsched-pressure
algorithm.
(rs6000_compute_pressure_classes): Implement target hook.

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-29 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Aldy Hernandez  changed:

   What|Removed |Added

 Status|REOPENED|NEW

--- Comment #5 from Aldy Hernandez  ---
Ok, cpu makes a difference.  Thanks.

Confirmed with a cross to --target=powerpc-linux-gnu and:

./cc1 ~/a.c -quiet -O2 -fmodulo-sched -fselective-scheduling2 -I./ -mcpu=power7

Plus the following to make up for the missing assembler:

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 145ac86..0a8fa6a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c   
@@ -4132,6 +4132,7 @@ rs6000_option_override_internal (bool global_init_p)
default:
  break;
}
+  unavailable_cpu=0;
   if (unavailable_cpu)
{
  cpu_index = -1;

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-29 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Arseny Solokha  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WORKSFORME  |---

--- Comment #4 from Arseny Solokha  ---
gcc/sel-sched.c:7150 in r255766 became sel-sched.c:7155 in 257131, which is

7149if (sched_verbose >= 2)
7150  {
7151sel_print ("scheduled insn %d, clock %d\n", INSN_UID (insn),
7152   haifa_clock + 1);
7153debug_state (curr_state);
7154  }
7155gcc_assert (cost < 0);
7156  }
7157
7158  if (targetm.sched.variable_issue)
7159targetm.sched.variable_issue (sched_dump, sched_verbose, insn, 0);

(In reply to Aldy Hernandez from comment #3)
> I tried again with latest trunk but still can't reproduce.  I even tried on
> a native PPC big endian box running in 32 bit mode (setarch).

% for cpu in 401 403 405 405fp 440 440fp 464 464fp 476 476fp 505 601 602 603
603e 604 604e 620 630 740 7400 7450 750 801 821 823 8540 8548 860 970 G3 G4 G5
a2 cell e300c2 e300c3 e500mc e500mc64 e5500 e6500 ec603e power3 power4 power5
power5+ power6 power6x power7 power8 power9 powerpc powerpc64 powerpc64le rs64
titan; do powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180128 -mcpu=$cpu -O2
-fmodulo-sched -fselective-scheduling2 -c tt.c || echo $cpu; done
during RTL pass: sched2
tt.c: In function 'ny':
tt.c:13:1: internal compiler error: in reset_sched_cycles_in_current_ebb, at
sel-sched.c:7155
 }
 ^
0xc08418 reset_sched_cycles_in_current_ebb
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sel-sched.c:7155
0xc08418 sel_region_target_finish
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sel-sched.c:7228
0xc08418 sel_region_finish
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sel-sched.c:7284
0xc08418 sel_sched_region(int)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sel-sched.c:7647
0xc08641 run_selective_scheduling()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sel-sched.c:7718
0xbdf4bd rest_of_handle_sched2
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sched-rgn.c:3729
0xbdf4bd execute
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/gcc/sched-rgn.c:3873
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
zsh: exit 1 powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180128 -mcpu=$cpu -O2
-fmodulo-sche
power7

So apparently the processor-specific scheduling parameters play a role here.

(In reply to Aldy Hernandez from comment #3)
> Reporter also
> filed PR84090, which also can't be reproduced by at least two people.

I wonder what exactly this is supposed to mean. The ICE reported in PR84090 had
indeed gone between r256935 and r257131 and that would be sorted out by me
later this week anyway.

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-29 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Aldy Hernandez  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #3 from Aldy Hernandez  ---
I tried again with latest trunk but still can't reproduce.  I even tried on a
native PPC big endian box running in 32 bit mode (setarch).  Reporter also
filed PR84090, which also can't be reproduced by at least two people.

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-28 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

--- Comment #2 from Arseny Solokha  ---
Yes, it's still an issue.

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180128 -v   
Using built-in specs.
COLLECT_GCC=powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180128
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128/lto-wrapper
Target: powerpc-e300c3-linux-gnu
Configured with:
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180128/work/gcc-8-20180128/configure
--host=x86_64-pc-linux-gnu --target=powerpc-e300c3-linux-gnu
--build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/powerpc-e300c3-linux-gnu/gcc-bin/8.0.0-alpha20180128
--includedir=/usr/lib/gcc/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128/include
--datadir=/usr/share/gcc-data/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128
--mandir=/usr/share/gcc-data/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128/man
--infodir=/usr/share/gcc-data/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128/info
--with-gxx-include-dir=/usr/lib/gcc/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128/include/g++-v8
--with-python-dir=/share/gcc-data/powerpc-e300c3-linux-gnu/8.0.0-alpha20180128/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --enable-checking=yes --disable-esp
--enable-libstdcxx-time --enable-poison-system-directories
--with-sysroot=/usr/powerpc-e300c3-linux-gnu --disable-bootstrap
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec
--disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx
--disable-vtable-verify --disable-libvtv --disable-libquadmath --enable-lto
--with-isl --disable-isl-version-check --disable-libsanitizer
Thread model: posix
gcc version 8.0.0-alpha20180128 20180128 (experimental) (GCC)

(as of r257131)

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-26 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-01-26
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Aldy Hernandez  ---
I cannot reproduce on mainline with a cross of:

--target=powerpc-e300c3-linux-gnu

or

--target=powerpc-linux-gnu

Is this still an issue on mainline?  FWIW, I couldn't reproduce with a cross
for r255766 as reported.

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug rtl-optimization/83530] [8 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.c:7150

2018-01-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83530

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0