re PR tree-optimization/69047 (memcpy is not as optimized as union is)

2016-08-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69047
	* gcc.dg/pr69047.c: Fix byte-order check.

From-SVN: r239857
This commit is contained in:
Richard Biener 2016-08-30 09:22:17 +00:00 committed by Richard Biener
parent 5116b156b7
commit 6f651baeb7
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2016-08-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/69047
* gcc.dg/pr69047.c: Fix byte-order check.
2016-08-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/72866

View File

@ -5,9 +5,9 @@ __UINT8_TYPE__
f(__UINT16_TYPE__ b)
{
__UINT8_TYPE__ a;
#if __BYTE_ORDER == __LITTLE_ENDIAN
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
__builtin_memcpy(&a, &b, sizeof a);
#elif __BYTE_ORDER == __BIG_ENDIAN
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
__builtin_memcpy(&a, (char *)&b + sizeof a, sizeof a);
#else
a = b;