[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #18 from Peter Bergner --- (In reply to seurer from comment #16) > gimple folding of rs6000 builtins has been disabled. > FAIL: gcc.target/powerpc/pr83926.c (test for excess errors) > > This happens on all the testers both BE and LE. I'm not sure how I missed that, but it needs the dg-prune-output like the builtins-1-be.c test case needed. Anyway, fixed now.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #17 from Peter Bergner --- Author: bergner Date: Fri Feb 9 22:03:43 2018 New Revision: 257543 URL: https://gcc.gnu.org/viewcvs?rev=257543=gcc=rev Log: PR target/83926 * gcc.target/powerpc/pr83926.c: Filter out gimple folding disabled message. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/powerpc/pr83926.c
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 seurer at gcc dot gnu.org changed: What|Removed |Added CC||seurer at gcc dot gnu.org --- Comment #16 from seurer at gcc dot gnu.org --- That new test case appears to be failing: Executing on host: /home/seurer/gcc/build/gcc-test/gcc/xgcc -B/home/seurer/gcc/build/gcc-test/gcc/ /home/seurer/gcc/gcc-test/gcc/testsuite/gcc.target/powerpc/pr83926.c -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -mcpu=power8 -mno-fold-gimple -S -o pr83926.s(timeout = 300) spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test/gcc/xgcc -B/home/seurer/gcc/build/gcc-test/gcc/ /home/seurer/gcc/gcc-test/gcc/testsuite/gcc.target/powerpc/pr83926.c -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -mcpu=power8 -mno-fold-gimple -S -o pr83926.s gimple folding of rs6000 builtins has been disabled. FAIL: gcc.target/powerpc/pr83926.c (test for excess errors) This happens on all the testers both BE and LE.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 Peter Bergner changed: What|Removed |Added Status|RESOLVED|CLOSED Target Milestone|--- |8.0 --- Comment #15 from Peter Bergner --- Closing as fixed.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 Peter Bergner changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #14 from Peter Bergner --- Fix committed to trunk.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #13 from Peter Bergner --- Author: bergner Date: Fri Feb 9 16:32:37 2018 New Revision: 257531 URL: https://gcc.gnu.org/viewcvs?rev=257531=gcc=rev Log: gcc/ PR target/83926 * config/rs6000/vsx.md (vsx_mul_v2di): Handle generating a 64-bit multiply in 32-bit mode. (vsx_div_v2di): Handle generating a 64-bit signed divide in 32-bit mode. (vsx_udiv_v2di): Handle generating a 64-bit unsigned divide in 32-bit mode. gcc/testsuite/ PR target/83926 * gcc.target/powerpc/pr83926.c: New test. * gcc.target/powerpc/builtins-1-be.c: Filter out gimple folding disabled message. Fix test for running in 32-bit mode. Added: trunk/gcc/testsuite/gcc.target/powerpc/pr83926.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/vsx.md trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/powerpc/builtins-1-be.c
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 Peter Bergner changed: What|Removed |Added Keywords|ra | URL||https://gcc.gnu.org/ml/gcc- ||patches/2018-02/msg00439.ht ||ml --- Comment #12 from Peter Bergner --- I've submitted another patch. It ends up splitters in vsx.md are calling gen_divdi3(), gen_udivdi3() and gen_muldi3() in 32-bit mode when those patterns are not supported in 32-bit mode...so this is not a RA bug, but a target bug.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 Peter Bergner changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |bergner at gcc dot gnu.org --- Comment #11 from Peter Bergner --- I have two patches 1) modify gen_[u]divdi3() to handle calling the lib func __[u]divdi3 when needed and 2) Call expand_divmod() in the vsx_[u]div_v2di splitters. I'm evaluating which generates better code.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #10 from Peter Bergner --- A similar error happens with the __builtin_vsx_udiv_2di() that happens with __builtin_vsx_div_2di(), which shows the splitter for vsx_udiv_v2di calling gen_udivdi3() directly: [bergner@makalu-lp1 PR83926]$ cat udiv.i __attribute__ ((altivec(vector__))) unsigned long long foo (__attribute__ ((altivec(vector__))) unsigned long long a, __attribute__ ((altivec(vector__))) unsigned long long b) { return __builtin_vsx_udiv_2di (a, b); } [bergner@makalu-lp1 PR83926]$ /home/bergner/gcc/build/gcc-fsf-mainline-pr83926-debug/gcc/xgcc -B/home/bergner/gcc/build/gcc-fsf-mainline-pr83926-debug/gcc -S -mcpu=power8 -O1 -m32 -mno-fold-gimple udiv.i gimple folding of rs6000 builtins has been disabled. udiv.i: In function ‘foo’: udiv.i:6:1: error: unrecognizable insn: } ^ (insn 16 15 17 2 (set (reg:DI 127) (udiv:DI (reg:DI 125) (reg:DI 126))) "udiv.i":6 -1 (nil)) during RTL pass: subreg2 udiv.i:6:1: internal compiler error: in extract_insn, at recog.c:2304 0x10ddd69f _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/bergner/gcc/gcc-fsf-mainline-pr83926/gcc/rtl-error.c:108
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #9 from Peter Bergner --- So the problem is that the splitter for vsx_div_v2di unconditionally calls gen_divdi3() , which assumes we have a 64-bit integer HW div insn. If you do a scalar 64-bit div, we notice we don't have that HW insn and expand calls the __divdi3 library function. Maybe in gen_divdi3() we could detect whether we need to do that same? I'll see if I can come up with something.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 Peter Bergner changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2018-01-30 Ever confirmed|0 |1 --- Comment #8 from Peter Bergner --- A minimal test case that fails with -O[123]: [bergner@makalu-lp1 PR83926]$ cat pr83926.i __attribute__ ((altivec(vector__))) long long foo (__attribute__ ((altivec(vector__))) long long a, __attribute__ ((altivec(vector__))) long long b) { return __builtin_vec_div (a, b); } [bergner@makalu-lp1 PR83926]$ /home/bergner/gcc/build/gcc-fsf-mainline-pr83926-debug/gcc/xgcc -B/home/bergner/gcc/build/gcc-fsf-mainline-pr83926-debug/gcc -S -mcpu=power8 -O1 -m32 -mno-fold-gimple pr83926.i gimple folding of rs6000 builtins has been disabled. pr83926.i: In function ‘foo’: pr83926.i:6:1: error: unrecognizable insn: } ^ (insn 16 15 17 2 (set (reg:DI 127) (div:DI (reg:DI 125) (reg:DI 126))) "pr83926.i":6 -1 (nil)) during RTL pass: subreg2 pr83926.i:6:1: internal compiler error: in extract_insn, at recog.c:2304 0x10ddd69f _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/bergner/gcc/gcc-fsf-mainline-pr83926/gcc/rtl-error.c:108 In reply to Segher's suggestion of doing what the 32-bit DImode divides do, they end up emitting calls to __divdi3().
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #7 from Segher Boessenkool --- It is first V2DI in the RTL, which exists just fine (but there is no such divide insn); then when it is split to two DImode divides, it just generates div:DI etc., which does not exist for -m32. So we either should do what is done for a DImode divides during expand there, or not allow this builtin.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #6 from Bill Schmidt --- But I assume that's your transcription error. In the test case the arguments are vector long long.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #5 from Bill Schmidt --- That looks completely invalid, the args should be vector long long, not long long.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #4 from Will Schmidt --- I'm having a moment of doubt on the validity of the testcases involved here. vector long long a = vec_div(long long b, long long c); Any chance that is invalid for -m32 ? I don't see a whole lot of vec_div() references in the test suite with long long types. I don't see it called out in the ABI, but the VSX_BUILTIN_DIV_V2DI and VSX_BUILTIN_UDIV_V2DI do seem to exist.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #3 from Will Schmidt --- (In reply to Bill Schmidt from comment #2) > Does this work on GCC 7 (obviously without -mno-fold-gimple)? If so, please > mark as [8 regression] in title. looks like No, this also fails on the gcc 7 branch. (the -mno-fold-gimple option, as well as the vec_div folding, were both added after gcc7 branched.) (On a Power7) # checkout svn co svn://gcc.gnu.org/svn/gcc/branches/gcc-7-branch gcc-7-branch # configure ../../gcc-7-branch/configure --enable-languages=c,c++,fortran,objc,obj-c++ --with-cpu=power7 --disable-multilib --with-long-double-128 --prefix=/home/willschm/gcc/install/gcc-7-branch --disable-bootstrap # check version ~/gcc/build/gcc-7-branch> /home/willschm/gcc/build/gcc-7-branch/gcc/xgcc -v Using built-in specs. COLLECT_GCC=/home/willschm/gcc/build/gcc-7-branch/gcc/xgcc Target: powerpc64-unknown-linux-gnu Configured with: ../../gcc-7-branch/configure --enable-languages=c,c++,fortran,objc,obj-c++ --with-cpu=power7 --disable-multilib --with-long-double-128 --prefix=/home/willschm/gcc/install/gcc-7-branch --disable-bootstrap Thread model: posix gcc version 7.2.1 20180124 (GCC) # run ~/gcc/build/gcc-7-branch> /home/willschm/gcc/build/gcc-7-branch/gcc/xgcc -B/home/willschm/gcc/build/gcc-7-branch/gcc/ /home/willschm/testme.c -fno-diagnostics-show-caret -fdiagnostics-color=never -maltivec -ffat-lto-objects -S -o testme.o -m32 /home/willschm/testme.c: In function ‘main’: /home/willschm/testme.c:19:1: internal compiler error: in elimination_costs_in_insn, at reload1.c:3617 0x10699b5b elimination_costs_in_insn ../../../gcc-7-branch/gcc/reload1.c:3614 0x1069a3db calculate_elim_costs_all_insns() ../../../gcc-7-branch/gcc/reload1.c:1607 0x10537343 ira_costs() ../../../gcc-7-branch/gcc/ira-costs.c:2261 0x1052f443 ira_build() ../../../gcc-7-branch/gcc/ira-build.c:3420 0x10524187 ira ../../../gcc-7-branch/gcc/ira.c:5308 0x10524187 execute ../../../gcc-7-branch/gcc/ira.c:5619
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 --- Comment #2 from Bill Schmidt --- Does this work on GCC 7 (obviously without -mno-fold-gimple)? If so, please mark as [8 regression] in title.
[Bug target/83926] ICE during RTL pass: ira, in elimination_costs_in_insn, at reload1.c:3633
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83926 Will Schmidt changed: What|Removed |Added CC||willschm at gcc dot gnu.org --- Comment #1 from Will Schmidt --- Created attachment 43172 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43172=edit ira dump ira dump.