[Bug tree-optimization/50417] regression: memcpy with known alignment
gjl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Oct 9 09:25:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50417
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Target|sh*-*-* arm*-*-* avr*-*-* |sh*-*-* arm*-*-*
CC| |gjl at gcc dot gnu.org
--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> The middle-end does not know anything about the parameters alignment.
But the following code will use SImode load / store, even on strict-alignment
backends
void test (const int* a, int* b)
{
*b = *a;
}
If SImode operations are in order here, why not in memcpy et al. provided it is
feeded with int*?
In the case where an unaligned pointer is used in *b = *a and this causes, e.g.
a trap, this is in order. Similar should apply for memcpy on strict-alignment
machines if it gets an unaligned int* for example and the size is a multiple of
the alignment requirement.
BTW: AVR is an 8-bit machine that copies in chunks of 1 byte, this applies also
for 4.5 and older. avr-gcc is /not/ a strict alignment backend. Thul removed
from the targets.
More information about the Gcc-bugs
mailing list