]> gcc.gnu.org Git - gcc.git/commitdiff
i386.c (classify_argument): Promote partial integer class to full integer class if...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 3 Nov 2008 20:05:45 +0000 (20:05 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 3 Nov 2008 20:05:45 +0000 (20:05 +0000)
* 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

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20081103-1.c [new file with mode: 0644]

index caf616a4784f961221cee11a5d206546289be208..0e826df9784d76d933f615094298a887298d7fe8 100644 (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
index 62249bb08ba49d61b4aa85663793f67784cacf27..ed18fcc973f49bf71b8794780a753b2643fa0404 100644 (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++)
index 626145ef634167675a01fdde1e59d8c44884b488..78e1ef62188d3a28074d32d7fc1ddb4fd87a94ee 100644 (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.
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 (file)
index 0000000..c458fbc
--- /dev/null
@@ -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;
+}
This page took 0.165361 seconds and 5 git commands to generate.