Bug 77526 - [7 Regression] ICE: in verify_dominators, at dominance.c:1039 with -mstringop-strategy=byte_loop
Summary: [7 Regression] ICE: in verify_dominators, at dominance.c:1039 with -mstringop...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 7.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2016-09-08 11:29 UTC by Zdenek Sojka
Modified: 2016-09-16 07:11 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Known to work: 6.2.1
Known to fail: 7.0
Last reconfirmed: 2016-09-13 00:00:00


Attachments
reduced testcase (146 bytes, text/plain)
2016-09-08 11:29 UTC, Zdenek Sojka
Details
gcc7-pr77526.patch (663 bytes, patch)
2016-09-15 14:20 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2016-09-08 11:29:22 UTC
Created attachment 39583 [details]
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fno-forward-propagate -fno-gcse -fno-rerun-cse-after-loop -mstringop-strategy=byte_loop testcase.c -Wno-psabi
testcase.c: In function 'foo':
testcase.c:9:1: error: dominator of 5 should be 4, not 2
 }
 ^
testcase.c:9:1: internal compiler error: in verify_dominators, at dominance.c:1039
0x7bd965 verify_dominators(cdi_direction)
        /repo/gcc-trunk/gcc/dominance.c:1039
0x7bdb8f checking_verify_dominators
        /repo/gcc-trunk/gcc/dominance.h:71
0x7bdb8f calculate_dominance_info(cdi_direction)
        /repo/gcc-trunk/gcc/dominance.c:664
0x74acdd flow_loops_find(loops*)
        /repo/gcc-trunk/gcc/cfgloop.c:419
0x9ff122 loop_optimizer_init(unsigned int)
        /repo/gcc-trunk/gcc/loop-init.c:93
0x14dd398 if_convert
        /repo/gcc-trunk/gcc/ifcvt.c:5407
0x14df20d execute
        /repo/gcc-trunk/gcc/ifcvt.c:5628
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-240036-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160908 (experimental) (GCC) 

Tested revisions:
r240036 - ICE
6-branch r239849 - OK
Comment 1 Jakub Jelinek 2016-09-13 14:05:11 UTC
Started with r236114.
Comment 2 Jakub Jelinek 2016-09-15 14:20:11 UTC
Created attachment 39625 [details]
gcc7-pr77526.patch

Untested fix.
Comment 3 Jakub Jelinek 2016-09-16 07:10:40 UTC
Author: jakub
Date: Fri Sep 16 07:10:08 2016
New Revision: 240174

URL: https://gcc.gnu.org/viewcvs?rev=240174&root=gcc&view=rev
Log:
	PR target/77526
	* combine.c (rest_of_handle_combine): If any edges have been purged,
	free dominators if available.

	* gcc.target/i386/pr77526.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr77526.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Jakub Jelinek 2016-09-16 07:11:37 UTC
Fixed.