diff mbox series

GCC 8 Backports for AIX

Message ID CAGWvnynDDjbBjNGiKEbjPtqRwyA1mxPb=MO0BFAR53Qw1p+jmA@mail.gmail.com
State New
Headers show
Series GCC 8 Backports for AIX | expand

Commit Message

David Edelsohn May 14, 2019, 1:42 p.m. UTC
I would like to backport two AIX-specific patches to GCC 8.  These
both fix bugs that generate wrong code on AIX.

1) XCOFF private read only data section

2) Follow AIX ABI to not pass FP structures in FPRs.

These patches have been on trunk / GCC 9 for months.

Bootstrapped gcc-8-branch on powerpc-ibm-aix7.2.0.0.

Is this okay?

Thanks, David

        * 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 xcoff_private_rodata_section_name.
        (rs6000_xcoff_file_start): Generate xcoff_private_rodata_section_name.

        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.

Comments

Segher Boessenkool May 14, 2019, 6:15 p.m. UTC | #1
On Tue, May 14, 2019 at 09:42:58AM -0400, David Edelsohn wrote:
> I would like to backport two AIX-specific patches to GCC 8.  These
> both fix bugs that generate wrong code on AIX.
> 
> 1) XCOFF private read only data section
> 
> 2) Follow AIX ABI to not pass FP structures in FPRs.
> 
> These patches have been on trunk / GCC 9 for months.
> 
> Bootstrapped gcc-8-branch on powerpc-ibm-aix7.2.0.0.
> 
> Is this okay?

Sure!  For GCC 7 too, if you want?


Segher


>         * 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 xcoff_private_rodata_section_name.
>         (rs6000_xcoff_file_start): Generate xcoff_private_rodata_section_name.
> 
>         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.
diff mbox series

Patch

Index: xcoffout.c
===================================================================
--- xcoffout.c  (revision 271131)
+++ xcoffout.c  (working copy)
@@ -64,6 +64,7 @@ 

 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: xcoffout.h
===================================================================
--- xcoffout.h  (revision 271131)
+++ xcoffout.h  (working copy)
@@ -127,6 +127,7 @@ 

 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;
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c      (revision 271131)
+++ config/rs6000/rs6000.c      (working copy)
@@ -12615,7 +12615,9 @@  rs6000_function_arg (cumulative_args_t cum_v, mach
       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;
@@ -12751,7 +12753,9 @@  rs6000_arg_partial_bytes (cumulative_args_t cum_v,

   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;

@@ -34218,6 +34222,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,
@@ -34228,10 +34236,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);

@@ -34412,6 +34416,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,