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

            Bug ID: 68809
           Summary: [6 Regression] ICE: verify_gimple failed (error: type
                    mismatch in binary expression) w/ -O2 (-O3, -Ofast)
                    -floop-nest-optimize
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

1. 6.0.0-alpha20151206 for both x86_64-pc-linux-gnu and
powerpc-e500v2-linux-gnuspe ICEs when compiling the following reduced snippet
w/ -O2 (and above) -floop-nest-optimize:

int ae, vs;
char ue;

void
kc(char);

void
pm(void)
{
  unsigned int v9;
  int gf = 0;
  vs = 1;
  while (vs) {
    gf -= ue;
    kc(ue);
    for (ae = 0; ae < 70; ++ae) {
    }
    ae &= 4;
    ae ^ (gf != 0) && ((ue = 0) != 0);
  }
  v9 = ue + 1;
  ue - v9 && ((ue = 0) != 0);
}

% x86_64-pc-linux-gnu-gcc-6.0.0-alpha20151206 -c -O2 -floop-nest-optimize
krqo19j8.c
krqo19j8.c: In function 'pm':
krqo19j8.c:8:1: error: type mismatch in binary expression
 pm(void)
 ^~

int

char

int

_25 = prephitmp_37 + 1;
krqo19j8.c:8:1: internal compiler error: verify_gimple failed

2. A slight reorganization of expressions in this snippet demonstrates another
error during GIMPLE verification, which is reproducible for
x86_64-pc-linux-gnu, but not powerpc-e500v2-linux-gnuspe:

int ae, vs, gf;
char ue;

void
kc(char);

void
pm(void)
{
  unsigned int v9;
  int td = (gf != 0);
  while (vs) {
    kc(ue);
    for (ae = 0; ae < 70; ++ae) {
    }
    ae &= 4;
    ae ^ td && ((ue = 0) != 0);
    ++vs;
  }
  v9 = ue + 1;
  ue - v9 && ((ue = 0) != 0);
}

ostkomke.c: In function 'pm':
ostkomke.c:8:1: error: incompatible types in PHI argument 0
 pm(void)
 ^~

int

char

prephitmp_47 = PHI <prephitmp_34(14), _46(3)>
ostkomke.c:8:1: internal compiler error: verify_gimple failed

Reply via email to