~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/99/996733374c7d166fcc64f6d1bcf92d893bea7d8d.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: ppc64el, fix ELFv2 homogeneous float aggregate ABI bug
 
2
 
 
3
Subject: [PATCH, rs6000, 4.8/4.9] Fix ELFv2 homogeneous float aggregate ABI bug
 
4
 
 
5
Hello,
 
6
 
 
7
this is the variant intended for the 4.8/4.9 branches of the patch:
 
8
https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00994.html
 
9
 
 
10
As discussed, it does *not* actually change ABI, but only warn when
 
11
encountering a situation where the ABI will change in a future GCC.
 
12
(Avoiding the specific term "GCC 4.10" here since I'm not certain
 
13
whether the next GCC release will in fact be called that ...)
 
14
 
 
15
Tested on powerpc64-linux and powerpc64le-linux; also verified using
 
16
the ABI compat suite (against an unpatched GCC) that this patch does
 
17
not change the ABI.
 
18
 
 
19
OK for 4.8/4.9 once the mainline patch is in?
 
20
 
 
21
Bye,
 
22
Ulrich
 
23
 
 
24
 
 
25
gcc/ChangeLog:
 
26
 
 
27
        * config/rs6000/rs6000.c (rs6000_function_arg): If a float argument
 
28
        does not fit fully into floating-point registers, and there is still
 
29
        space in the register parameter area, issue -Wpsabi note that the ABI
 
30
        will change in a future GCC release.
 
31
 
 
32
gcc/testsuite/ChangeLog:
 
33
 
 
34
        * gcc.target/powerpc/ppc64-abi-warn-1.c: New test.
 
35
 
 
36
 
 
37
--- a/src/gcc/config/rs6000/rs6000.c
 
38
+++ b/src/gcc/config/rs6000/rs6000.c
 
39
@@ -10225,6 +10225,7 @@ rs6000_function_arg (cumulative_args_t c
 
40
          rtx r, off;
 
41
          int i, k = 0;
 
42
          unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
 
43
+         int fpr_words;
 
44
 
 
45
          /* Do we also need to pass this argument in the parameter
 
46
             save area?  */
 
47
@@ -10253,6 +10254,37 @@ rs6000_function_arg (cumulative_args_t c
 
48
              rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off);
 
49
            }
 
50
 
 
51
+         /* If there were not enough FPRs to hold the argument, the rest
 
52
+            usually goes into memory.  However, if the current position
 
53
+            is still within the register parameter area, a portion may
 
54
+            actually have to go into GPRs.
 
55
+
 
56
+            Note that it may happen that the portion of the argument
 
57
+            passed in the first "half" of the first GPR was already
 
58
+            passed in the last FPR as well.
 
59
+
 
60
+            For unnamed arguments, we already set up GPRs to cover the
 
61
+            whole argument in rs6000_psave_function_arg, so there is
 
62
+            nothing further to do at this point.
 
63
+
 
64
+            GCC 4.8/4.9 Note: This was implemented incorrectly in earlier
 
65
+            GCC releases.  To avoid any ABI change on the release branch,
 
66
+            we retain that original implementation here, but warn if we
 
67
+            encounter a case where the ABI will change in the future.  */
 
68
+         fpr_words = (i * GET_MODE_SIZE (elt_mode)) / (TARGET_32BIT ? 4 : 8);
 
69
+         if (i < n_elts && align_words + fpr_words < GP_ARG_NUM_REG
 
70
+             && cum->nargs_prototype > 0)
 
71
+            {
 
72
+             static bool warned;
 
73
+             if (!warned && warn_psabi)
 
74
+               {
 
75
+                 warned = true;
 
76
+                 inform (input_location,
 
77
+                         "the ABI of passing homogeneous float aggregates"
 
78
+                         " will change in a future GCC release");
 
79
+               }
 
80
+           }
 
81
+
 
82
          return rs6000_finish_function_arg (mode, rvec, k);
 
83
        }
 
84
       else if (align_words < GP_ARG_NUM_REG)
 
85
--- /dev/null
 
86
+++ b/src/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
 
87
@@ -0,0 +1,12 @@
 
88
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
 
89
+/* { dg-options "-mabi=elfv2" } */
 
90
+
 
91
+struct f8
 
92
+  {
 
93
+    float x[8];
 
94
+  };
 
95
+
 
96
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
 
97
+{
 
98
+}
 
99
+