Summary: | [4.6/4.7 Regression] ICE verify_gimple failed | ||
---|---|---|---|
Product: | gcc | Reporter: | John Regehr <regehr> |
Component: | tree-optimization | Assignee: | Richard Biener <rguenth> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chenyang, zsojka |
Priority: | P3 | ||
Version: | 4.7.0 | ||
Target Milestone: | 4.6.3 | ||
Host: | Target: | ||
Build: | Known to work: | 4.6.3, 4.7.0 | |
Known to fail: | 4.4.6, 4.5.3, 4.6.2 | Last reconfirmed: | 2011-11-10 00:00:00 |
Description
John Regehr
2011-11-09 20:52:03 UTC
Catched by copyprop, caused by loop distributions memset replacement. Fails in random ways on all branches that have loop distribution. A regression with -O3 (enabled by default) since 4.6. For <bb 5>: # g_224.0_23 = PHI <g_224.1_10(7), g_224.0_22(4)> # MEM = PHI <MEM, MEM> D.2957_3 = g_92[g_224.0_23]; g_92[g_224.0_23] = 0; g_352[g_224.0_23] = 1; g_224.1_10 = g_224.0_23 + 1; if (g_224.1_10 != 0) goto <bb 7>; else goto <bb 6>; <bb 6>: # g_95_I_lsm.15_29 = PHI <D.2957_3(5)> g_95[0] = g_95_I_lsm.15_29; g_224 = 0; goto <bb 3>; <bb 7>: goto <bb 5>; we generate partitions { 0 1 2 3 5 6 } and { 0 4 5 6 } note that the partition with the zero store also includes the load from g_92[g_224.0_23] which has a use outside of the loop. We cannot generate a memset replacement for this with the current code. I have a patch. Author: rguenth Date: Thu Nov 10 13:46:27 2011 New Revision: 181255 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181255 Log: 2011-11-10 Richard Guenther <rguenther@suse.de> PR tree-optimization/51070 * tree-loop-distribution.c (generate_builtin): Do not replace the loop with a builtin if the partition contains statements which results are used outside of the loop. (pass_loop_distribution): Verify and collect. * gcc.dg/torture/pr51070.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr51070.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-loop-distribution.c Fixed for 4.7 for now. The testcase fails with -O3 -fno-inline or with -O3 when func_37() is declared with __attribute__((noinline)). Compiler output: $ gcc -v Using built-in specs. COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-182733-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df --enable-languages=c,c++,lto,fortran --prefix=/mnt/svn/gcc-trunk/binary-182733-lto-fortran-checking-yes-rtl-df/ --with-cloog --with-ppl --with-cloog-include=/usr/include/cloog-ppl/ --disable-ppl-version-check Thread model: posix gcc version 4.7.0 20111229 (experimental) (GCC) $ gcc -O3 -fno-inline gcc.dg/torture/pr51070.c gcc.dg/torture/pr51070.c: In function 'func_9': gcc.dg/torture/pr51070.c:26:1: error: invalid PHI argument .MEM_5 gcc.dg/torture/pr51070.c:26:1: error: incompatible types in PHI argument 0 int void g_95_I_lsm.22_32 = PHI <.MEM_5(5)> gcc.dg/torture/pr51070.c:26:1: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. I didn't open a new PR because the ICE message is the same and the conditions under which it happens are very similiar. Of course, I will open a new PR if you tell me so. Confirmed. Author: rguenth Date: Tue Jan 3 12:07:18 2012 New Revision: 182839 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182839 Log: 2012-01-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/51070 * tree-loop-distribution.c (stmt_has_scalar_dependences_outside_loop): Properly handle calls. * gcc.dg/torture/pr51070-2.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr51070-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-loop-distribution.c Author: rguenth Date: Tue Jan 3 12:11:41 2012 New Revision: 182840 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182840 Log: 2012-01-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/51070 * tree-loop-distribution.c (generate_builtin): Do not replace the loop with a builtin if the partition contains statements which results are used outside of the loop. (stmt_has_scalar_dependences_outside_loop): Properly handle calls. * gcc.dg/torture/pr51070.c: New testcase. * gcc.dg/torture/pr51070-2.c: Likewise. Added: branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr51070-2.c branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr51070.c Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/gcc/tree-loop-distribution.c Fixed. Author: liujiangning Date: Tue Jun 12 09:44:24 2012 New Revision: 188432 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188432 Log: 2011-06-12 Jiangning Liu <jiangning.liu@arm.com> Backport r182839 from mainline 2012-01-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/51070 * tree-loop-distribution.c (generate_builtin): Do not replace the loop with a builtin if the partition contains statements which results are used outside of the loop. (stmt_has_scalar_dependences_outside_loop): Properly handle calls. 2011-06-12 Jiangning Liu <jiangning.liu@arm.com> Backport r182839 from mainline 2012-01-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/51070 * gcc.dg/torture/pr51070.c: New testcase. * gcc.dg/torture/pr51070-2.c: Likewise. Added: branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.dg/torture/pr51070-2.c branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.dg/torture/pr51070.c Modified: branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm branches/ARM/embedded-4_6-branch/gcc/testsuite/ChangeLog.arm branches/ARM/embedded-4_6-branch/gcc/tree-loop-distribution.c |