This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/38932] New: ICE in set_value_range, at tree-vrp.c:398


>From PR38572, but unrelated to it:

void f (long long int p)
{
  int x;
  static unsigned char g;
  long long int min = -9223372036854775807LL - 1;
  g = 1;
  x = (signed char) (g | 249) / 4;
  if (p >= min - (long long int) x)
    p = 1;

  if (p)
    abort ();
}

gives

small.c: In function 'f':
small.c:3: internal compiler error: in set_value_range, at tree-vrp.c:398

Note that after FRE the code becomes the simpler

void f (long long int p)
{
  long long int min = 9223372036854775807LL + 2; /*0x7fffffffffffffff */
  if (min <= p)
    p = 1;

  if (p)
    abort ();
}

but this does not ICE because in this testcase the "min <= p" is changed to "p
!= min - 1" by the first CCP pass, so this is also a missed folding in FRE.

I'm looking at the VRP failure though.


-- 
           Summary: ICE in set_value_range, at tree-vrp.c:398
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bonzini at gnu dot org
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38932


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]