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 optimization/15274] New: loop2 creates invalid rtl


/* Taken from libf2c/libI77/util.c, the following ICEs on powerpc-linux
   with -O1 -S.
   "internal compiler error: in do_SUBST, at combine.c:440"  */

void
g_char (char *a, unsigned long alen, char *b)
{
  char *x = a + alen, *y = b + alen;

  for (;; y--)
    {
      if (x <= a)
	{
	  *b = 0;
	  return;
	}
      if (*--x != ' ')
	break;
    }
  *y-- = 0;
  do
    *y-- = *x;
  while (x-- > a);
}

The problem appears to be that loop-iv.c uses get_mode_bounds to find that the
max value for an unsigned SImode is 0xffffffff, and then uses this constant
directly in SImode RTL expressions, without converting the value via
trunc_int_for_mode.

-- 
           Summary: loop2 creates invalid rtl
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amodra at bigpond dot net dot au
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc-linux


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


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