function.c (locate_and_pad_parm): Don't align stack unconditionally.
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>
Tue, 17 Oct 2000 22:17:34 +0000 (22:17 +0000)
committerFranz Sirl <sirl@gcc.gnu.org>
Tue, 17 Oct 2000 22:17:34 +0000 (22:17 +0000)
2000-10-17  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

* function.c (locate_and_pad_parm): Don't align stack unconditionally.
Fixes execute/20001017-1.c on pwerpc-linux-gnu.
* expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only.
* rs6000/rs6000.c (rs6000_hash_constant): use X0INT to access a
LABEL_REF.
* rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS,
ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from
here...
* rs6000/aix.h: ...to here.
* rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style.

From-SVN: r36914

gcc/ChangeLog
gcc/config/rs6000/aix.h
gcc/config/rs6000/linux.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/expr.c
gcc/function.c

index ed52370eb7a74e08a82793cd2aa3710deed20207..a56ad456015dd0c9d93e41c2671f91d56bf57e40 100644 (file)
@@ -1,3 +1,18 @@
+2000-10-17  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+       * function.c (locate_and_pad_parm): Don't align stack unconditionally.
+       Fixes execute/20001017-1.c on pwerpc-linux-gnu.
+
+       * expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only.
+       * rs6000/rs6000.c (rs6000_hash_constant): use X0INT to access a
+       LABEL_REF.
+
+       * rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS,
+       ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from
+       here...
+       * rs6000/aix.h: ...to here.
+       * rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style.
+
 2000-10-17  Jakub Jelinek  <jakub@redhat.com>
 
        * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Reload gp if needed.
index 741f6c7f830b9fc70b07d1eb780cb523661f2600..080bfc39948c7c7da87b6178123df508133b83b3 100644 (file)
@@ -50,6 +50,17 @@ Boston, MA 02111-1307, USA.  */
 
 #define FASCIST_ASSEMBLER
 
+/* We define this to prevent the name mangler from putting dollar signs into
+   function names.  */
+
+#define NO_DOLLAR_IN_LABEL
+
+/* We define this to 0 so that gcc will never accept a dollar sign in a
+   variable name.  This is needed because the AIX assembler will not accept
+   dollar signs.  */
+
+#define DOLLARS_IN_IDENTIFIERS 0
+
 /* AIX does not have any init/fini or ctor/dtor sections, so create
     static constructors and destructors as normal functions.  */
 /* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */
@@ -227,6 +238,30 @@ toc_section ()                                             \
     }                                                  \
 }
 
+/* Return non-zero if this entry is to be written into the constant
+   pool in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF
+   or a CONST containing one of them.  If -mfp-in-toc (the default),
+   we also do this for floating-point constants.  We actually can only
+   do this if the FP formats of the target and host machines are the
+   same, but we can't check that since not every file that uses
+   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.  We also do this when
+   we can write the entry into the TOC and the entry is not larger
+   than a TOC entry.  */
+
+#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                       \
+  (TARGET_TOC                                                          \
+   && (GET_CODE (X) == SYMBOL_REF                                      \
+       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS     \
+          && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
+       || GET_CODE (X) == LABEL_REF                                    \
+       || (GET_CODE (X) == CONST_INT                                   \
+          && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
+       || (GET_CODE (X) == CONST_DOUBLE                                        \
+          && (TARGET_POWERPC64                                         \
+              || TARGET_MINIMAL_TOC                                    \
+              || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
+                  && ! TARGET_NO_FP_IN_TOC)))))
+
 /* Select section for constant in constant pool.
 
    On RS/6000, all constants are in the private read-only data area.
@@ -240,6 +275,17 @@ toc_section ()                                             \
     read_only_private_data_section ();                 \
 }
 
+/* If we are referencing a function that is static or is known to be
+   in this file, make the SYMBOL_REF special.  We can use this to indicate
+   that we can branch to this function without emitting a no-op after the
+   call.  Do not set this flag if the function is weakly defined. */
+
+#define ENCODE_SECTION_INFO(DECL)                      \
+  if (TREE_CODE (DECL) == FUNCTION_DECL                        \
+      && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
+      && ! DECL_WEAK (DECL))                           \
+    SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
+
 /* Indicate that jump tables go in the text section.  */
 
 #define JUMP_TABLES_IN_TEXT_SECTION 1
index a28a8bdfdd501314cece13601ee33f1747abc47d..9fe8501f494a97a74768722767ca53c96aaed73e 100644 (file)
@@ -54,6 +54,14 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
 
+/* Override rs6000.h definition.  */
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+/* Override rs6000.h definition.  */
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
 #undef DEFAULT_VTABLE_THUNKS
 #ifndef USE_GNULIBC_1
 #define DEFAULT_VTABLE_THUNKS 1
index 9250bc1695e2febd96c1779d4f1b3f7ee73aae87..789a2f7f48fba430b2a8480699a41ce31f108fcd 100644 (file)
@@ -6556,7 +6556,7 @@ rs6000_hash_constant (k)
   int fidx;
   
   if (GET_CODE (k) == LABEL_REF)
-    return result * 1231 + XINT (XEXP (k, 0), 3);
+    return result * 1231 + X0INT (XEXP (k, 0), 3);
 
   if (GET_CODE (k) == CONST_DOUBLE)
     fidx = 2;
index 8ab59cb698086fa962ab3c958e1537a5ca4e1790..3bb567b773b6d03e1fcad35d2846daa14613dcb2 100644 (file)
@@ -2310,17 +2310,6 @@ extern int rs6000_compare_fp_p;
    the end of the line.  */
 #define ASM_COMMENT_START " #"
 
-/* We define this to prevent the name mangler from putting dollar signs into
-   function names.  */
-
-#define NO_DOLLAR_IN_LABEL
-
-/* We define this to 0 so that gcc will never accept a dollar sign in a
-   variable name.  This is needed because the AIX assembler will not accept
-   dollar signs.  */
-
-#define DOLLARS_IN_IDENTIFIERS 0
-
 /* Implicit library calls should use memcpy, not bcopy, etc.  */
 
 #define TARGET_MEM_FUNCTIONS
@@ -2331,44 +2320,9 @@ extern int rs6000_compare_fp_p;
 
 #define EXCEPTION_SECTION data_section
 
-/* If we are referencing a function that is static or is known to be
-   in this file, make the SYMBOL_REF special.  We can use this to indicate
-   that we can branch to this function without emitting a no-op after the
-   call.  Do not set this flag if the function is weakly defined. */
-
-#define ENCODE_SECTION_INFO(DECL)                      \
-  if (TREE_CODE (DECL) == FUNCTION_DECL                        \
-      && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
-      && ! DECL_WEAK (DECL))                           \
-    SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
-
 /* Flag to say the TOC is initialized */
 extern int toc_initialized;
 
-/* Return non-zero if this entry is to be written into the constant
-   pool in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF
-   or a CONST containing one of them.  If -mfp-in-toc (the default),
-   we also do this for floating-point constants.  We actually can only
-   do this if the FP formats of the target and host machines are the
-   same, but we can't check that since not every file that uses
-   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.  We also do this when
-   we can write the entry into the TOC and the entry is not larger
-   than a TOC entry.  */
-
-#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                       \
-  (TARGET_TOC                                                          \
-   && (GET_CODE (X) == SYMBOL_REF                                      \
-       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS     \
-          && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
-       || GET_CODE (X) == LABEL_REF                                    \
-       || (GET_CODE (X) == CONST_INT                                   \
-          && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
-       || (GET_CODE (X) == CONST_DOUBLE                                        \
-          && (TARGET_POWERPC64                                         \
-              || TARGET_MINIMAL_TOC                                    \
-              || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
-                  && ! TARGET_NO_FP_IN_TOC)))))
-
 /* Macro to output a special constant pool entry.  Go to WIN if we output
    it.  Otherwise, it is written the usual way.
 
index 2115a471ae98403c1de088a6590efb518a0126c8..01c1fb66b6bba3acb6d4fd5d01d8dbc97c1e4057 100644 (file)
@@ -4206,7 +4206,8 @@ store_constructor_field (target, bitsize, bitpos,
                            plus_constant (XEXP (target, 0),
                                           bitpos / BITS_PER_UNIT));
 
-      MEM_ALIAS_SET (target) = alias_set;
+      if (GET_CODE (target) == MEM)
+       MEM_ALIAS_SET (target) = alias_set;
       store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT);
     }
   else
index 4cf71195a1f7569f47d4273427e73c5346e28d6c..07528ec3298e8bc2db1223386cc72f4c07fe241c 100644 (file)
@@ -5149,7 +5149,12 @@ locate_and_pad_parm (passed_mode, type, in_regs, fndecl,
                              - offset_ptr->constant);
 
 #else /* !ARGS_GROW_DOWNWARD */
-  pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad);
+  if (!in_regs
+#ifdef REG_PARM_STACK_SPACE
+      || REG_PARM_STACK_SPACE (fndecl) > 0
+#endif
+      )
+    pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad);
   *offset_ptr = *initial_offset_ptr;
 
 #ifdef PUSH_ROUNDING