i386.c (classify_argument): Promote partial integer class to full integer class if...

* config/i386/i386.c (classify_argument) <ARRAY_TYPE>: Promote partial
	integer class to full integer class if the offset is not word-aligned.

From-SVN: r141559
This commit is contained in:
Eric Botcazou 2008-11-03 20:05:45 +00:00 committed by Eric Botcazou
parent 5b31bbabe9
commit dffda765c0
4 changed files with 28 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-11-03 Eric Botcazou <ebotcazou@adacore.com>
* config/i386/i386.c (classify_argument) <ARRAY_TYPE>: Promote partial
integer class to full integer class if the offset is not word-aligned.
2008-11-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR rtl-opt/37782

View File

@ -4930,7 +4930,8 @@ classify_argument (enum machine_mode mode, const_tree type,
/* The partial classes are now full classes. */
if (subclasses[0] == X86_64_SSESF_CLASS && bytes != 4)
subclasses[0] = X86_64_SSE_CLASS;
if (subclasses[0] == X86_64_INTEGERSI_CLASS && bytes != 4)
if (subclasses[0] == X86_64_INTEGERSI_CLASS
&& !((bit_offset % 64) == 0 && bytes == 4))
subclasses[0] = X86_64_INTEGER_CLASS;
for (i = 0; i < words; i++)

View File

@ -1,3 +1,7 @@
2008-11-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20081103-1.c: New test.
2008-11-03 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array5.adb New test.

View File

@ -0,0 +1,17 @@
struct S { char c; char arr[4]; float f; };
char A[4] = { '1', '2', '3', '4' };
void foo (struct S s)
{
if (__builtin_memcmp (s.arr, A, 4))
__builtin_abort ();
}
int main (void)
{
struct S s;
__builtin_memcpy (s.arr, A, 4);
foo (s);
return 0;
}