]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/61976 (aix64: Data corruption in struct passed by value)
authorDavid Edelsohn <dje.gcc@gmail.com>
Wed, 15 May 2019 17:11:31 +0000 (17:11 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Wed, 15 May 2019 17:11:31 +0000 (13:11 -0400)
        Backport from mainline
        2019-04-11  David Edelsohn  <dje.gcc@gmail.com>
        * xcoffout.h (xcoff_private_rodata_section_name): Declare.
        * xcoffout.c (xcoff_private_rodata_section_name): Define.
        * config/rs6000/rs6000.c (rs6000_xcoff_asm_init_sections): Create
        read_only_private_data_section using coff_private_rodata_section_name.
        (rs6000_xcoff_file_start): Generate coff_private_rodata_section_name.

        2018-12-04  David Edelsohn  <dje.gcc@gmail.com>
        2018-12-13  David Edelsohn  <dje.gcc@gmail.com>
        PR target/61976
        * config/rs6000/rs6000.c (rs6000_function_arg): Don't pass aggregates
        in FPRs on AIX. Ensure type is non-NULL.
        (rs6000_arg_partial_bytes): Same.

From-SVN: r271257

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/xcoffout.c
gcc/xcoffout.h

index 3e6a1f2db43ef95552e23265d80029d104fc9a60..6ed560907a40269c9c392e454f7c131938ed4701 100644 (file)
@@ -1,3 +1,20 @@
+2019-05-15  David Edelsohn  <dje.gcc@gmail.com>
+
+       Backport from mainline
+       2019-04-11  David Edelsohn  <dje.gcc@gmail.com>
+       * xcoffout.h (xcoff_private_rodata_section_name): Declare.
+       * xcoffout.c (xcoff_private_rodata_section_name): Define.
+       * config/rs6000/rs6000.c (rs6000_xcoff_asm_init_sections): Create
+       read_only_private_data_section using coff_private_rodata_section_name.
+       (rs6000_xcoff_file_start): Generate coff_private_rodata_section_name.
+
+       2018-12-04  David Edelsohn  <dje.gcc@gmail.com>
+       2018-12-13  David Edelsohn  <dje.gcc@gmail.com>
+       PR target/61976
+       * config/rs6000/rs6000.c (rs6000_function_arg): Don't pass aggregates
+       in FPRs on AIX. Ensure type is non-NULL.
+       (rs6000_arg_partial_bytes): Same.
+
 2019-05-15  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        * config/arm/t-rtems: Replace -march=armv7-m multilibs with
index 52ff18594d8719edf68522eb2606becf2a199761..ddf412137bb578e26aacddb03abdd348f5c01a19 100644 (file)
@@ -13144,7 +13144,9 @@ rs6000_function_arg (cumulative_args_t cum_v, machine_mode mode,
       if (elt_mode == TDmode && (cum->fregno % 2) == 1)
        cum->fregno++;
 
-      if (USE_FP_FOR_ARG_P (cum, elt_mode))
+      if (USE_FP_FOR_ARG_P (cum, elt_mode)
+         && !(TARGET_AIX && !TARGET_ELF
+              && type != NULL && AGGREGATE_TYPE_P (type)))
        {
          rtx rvec[GP_ARG_NUM_REG + AGGR_ARG_NUM_REG + 1];
          rtx r, off;
@@ -13280,7 +13282,9 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode,
 
   align_words = rs6000_parm_start (mode, type, cum->words);
 
-  if (USE_FP_FOR_ARG_P (cum, elt_mode))
+  if (USE_FP_FOR_ARG_P (cum, elt_mode)
+      && !(TARGET_AIX && !TARGET_ELF
+          && type != NULL && AGGREGATE_TYPE_P (type)))
     {
       unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;
 
@@ -36465,6 +36469,10 @@ rs6000_xcoff_asm_init_sections (void)
                           rs6000_xcoff_output_readwrite_section_asm_op,
                           &xcoff_private_data_section_name);
 
+  read_only_private_data_section
+    = get_unnamed_section (0, rs6000_xcoff_output_readonly_section_asm_op,
+                          &xcoff_private_rodata_section_name);
+
   tls_data_section
     = get_unnamed_section (SECTION_TLS,
                           rs6000_xcoff_output_tls_section_asm_op,
@@ -36475,10 +36483,6 @@ rs6000_xcoff_asm_init_sections (void)
                           rs6000_xcoff_output_tls_section_asm_op,
                           &xcoff_private_data_section_name);
 
-  read_only_private_data_section
-    = get_unnamed_section (0, rs6000_xcoff_output_readonly_section_asm_op,
-                          &xcoff_private_data_section_name);
-
   toc_section
     = get_unnamed_section (0, rs6000_xcoff_output_toc_section_asm_op, NULL);
 
@@ -36659,6 +36663,8 @@ rs6000_xcoff_file_start (void)
                           main_input_filename, ".bss_");
   rs6000_gen_section_name (&xcoff_private_data_section_name,
                           main_input_filename, ".rw_");
+  rs6000_gen_section_name (&xcoff_private_rodata_section_name,
+                          main_input_filename, ".rop_");
   rs6000_gen_section_name (&xcoff_read_only_section_name,
                           main_input_filename, ".ro_");
   rs6000_gen_section_name (&xcoff_tls_data_section_name,
index c6eab21a55d644963361066c595a04e8e9cd877f..a83638d7f51a96e2a7c2f52cba7f589aa2759bb4 100644 (file)
@@ -63,6 +63,7 @@ static const char *xcoff_current_function_file;
 
 char *xcoff_bss_section_name;
 char *xcoff_private_data_section_name;
+char *xcoff_private_rodata_section_name;
 char *xcoff_tls_data_section_name;
 char *xcoff_tbss_section_name;
 char *xcoff_read_only_section_name;
index 6b0b0a07d8bcfb376e3dcc31c1b80d16624c6347..ec74824554de40e72984e1c87ea66d80b5406b16 100644 (file)
@@ -127,6 +127,7 @@ extern const char *xcoff_current_include_file;
 
 extern char *xcoff_bss_section_name;
 extern char *xcoff_private_data_section_name;
+extern char *xcoff_private_rodata_section_name;
 extern char *xcoff_tls_data_section_name;
 extern char *xcoff_tbss_section_name;
 extern char *xcoff_read_only_section_name;