aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-11-03 20:05:45 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-11-03 20:05:45 +0000
commitdffda765c064a083dc7efdd1670d10d8b8b84c1e (patch)
tree231b6a2da7098156849b422024d22a97508a340d /gcc
parent5b31bbabe9a1bf22ae4d6c3cd26fd876004f7ea8 (diff)
downloadgcc-dffda765c064a083dc7efdd1670d10d8b8b84c1e.zip
gcc-dffda765c064a083dc7efdd1670d10d8b8b84c1e.tar.gz
gcc-dffda765c064a083dc7efdd1670d10d8b8b84c1e.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20081103-1.c17
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index caf616a..0e826df 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 62249bb..ed18fcc 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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++)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 626145e..78e1ef6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
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.
2008-11-03 Richard Guenther <rguenther@suse.de>
diff --git a/gcc/testsuite/gcc.c-torture/execute/20081103-1.c b/gcc/testsuite/gcc.c-torture/execute/20081103-1.c
new file mode 100644
index 0000000..c458fbc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20081103-1.c
@@ -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;
+}