https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78751

            Bug ID: 78751
           Summary: [7 Regression] ICE in extract_insn, at recog.c:2311
                    (error: unrecognizable insn) w/ -Os -misel
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: powerpc-*-linux-gnu*

1. gcc-7.0.0-alpha20161204 snapshot ICEs when compiling the following reduced
snippet:

long long int ow;

int
sf (int xs, short int go)
{
  short int qu = (go > 0) ^ !!ow;

  if (qu != 0)
    for (qu = 1; qu != 0; ++qu)
      {
      }
  else
    for (;;)
      if (go != 0)
        go = &qu;

  return xs / 0;
}

% powerpc-e300c3-linux-gnu-gcc-7.0.0-alpha20161204 -misel -Os -w -c akrtpsd2.c
akrtpsd2.c: In function 'sf':
akrtpsd2.c:18:1: error: unrecognizable insn:
 }
 ^
(insn 64 63 65 2 (set (reg:SI 190)
        (ne:SI (reg:CC 179)
            (const_int 0 [0]))) -1
     (nil))
akrtpsd2.c:18:1: internal compiler error: in extract_insn, at recog.c:2311
0x3125251cc35 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/rtl-error.c:108
0x3125251cc8c _fatal_insn_not_found(rtx_def const*, char const*, int, char
const*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/rtl-error.c:116
0x312524e7d6f extract_insn(rtx_insn*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/recog.c:2311
0x31252cf82d9 decompose_multiword_subregs
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/lower-subreg.c:1467
0x31252cf97fc execute
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/lower-subreg.c:1734

2. gcc ICEs in elimination_costs_in_insn after changing the testcase in the
following ways:

--- akrtpsd2.c  2016-12-09 19:44:19.516180848 +0700
+++ u0fm5eug.c  2016-12-09 19:43:22.040670924 +0700
@@ -1,4 +1,4 @@
-long long int ow;
+long int ow;

 int
 sf (int xs, short int go)

or

--- akrtpsd2.c  2016-12-09 19:47:55.879831963 +0700                 
+++ mtgaxlsn.c  2016-12-09 19:47:44.145614943 +0700
@@ -3,7 +3,7 @@ long long int ow;
 int
 sf (int xs, short int go)
 {
-  short int qu = (go > 0) ^ !!ow;
+  short int qu = (go > 0) ^ !!go;

   if (qu != 0)
     for (qu = 1; qu != 0; ++qu)

% powerpc-e300c3-linux-gnu-gcc-7.0.0-alpha20161204 -misel -w -Os -c u0fm5eug.c 
u0fm5eug.c: In function 'sf':
u0fm5eug.c:18:1: internal compiler error: in elimination_costs_in_insn, at
reload1.c:3615
 }
 ^
0x30cbc1b6ede elimination_costs_in_insn
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/reload1.c:3612
0x30cbc1b7a4f calculate_elim_costs_all_insns()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/reload1.c:1607
0x30cbc053536 ira_costs()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/ira-costs.c:2222
0x30cbc04c549 ira_build()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/ira-build.c:3420
0x30cbc0425dc ira
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/ira.c:5222
0x30cbc0425dc execute
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-7.0.0_alpha20161204/work/gcc-7-20161204/gcc/ira.c:5527

Both ICEs can also be reproduced w/ e500 gnuspe target (where -misel is on by
default).

Reply via email to