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/9196] [3.4 regression] pointer arithmetic is misoptimized


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-08-11 02:55:06         |2003-08-23 18:57:02
               date|                            |
            Summary|[3.4 regression] Inlining of|[3.4 regression] pointer
                   |function with  pointer      |arithmetic is misoptimized
                   |arithmetic is misoptimized  |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-23 18:57 -------
The inner has nothing to do with this bug as I can reproduce it when I inlined it myself:
static void test_memrchr (void)
{
  it = "memrchr";
  void *ret;
  {
  __const char *__s = "abcd";
  int __c = 'z';
  size_t __n = 5;
{
  register unsigned long int __d0;

  register void *__res;
  if (__n == 0)
    { 
      ret = (void*)0;
      goto end;
    }
  __res = __s + __n - 1;
  __d0 = __n;

  __asm__ __volatile__
    ("std\n\t"
     "repne; scasb\n\t"
     "je 1f\n\t"
     "orl $-1,%0\n"
     "1:\tcld"
     : "+d" (__res), "+c" (__d0)
     : "a" (__c)
     : "cc");

  ret = (void*)(__res + 1);
}
  goto end;
  }
end:
  check (ret  == ((void *)0), 1);
}


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