[Bug target/26721] [4.2 Regression]: Gcc generates unaligned access

sje at cup dot hp dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 16 22:25:00 GMT 2006



------- Comment #6 from sje at cup dot hp dot com  2006-03-16 22:25 -------
Here is a cut down test case, I guess GCC is trying to map the strncpy into an
integer move without taking alignment into account.



extern char *strncpy (char *, const char *, __SIZE_TYPE__);
int main()
{
  const char *const foo = "hello world";
  char dst [64];

  strncpy (dst + 1, foo + 1, 4);
  return 0;
}


-- 

sje at cup dot hp dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-16 22:25:02
               date|                            |


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



More information about the Gcc-bugs mailing list