aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa/pa.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/pa/pa.h')
-rw-r--r--gcc/config/pa/pa.h81
1 files changed, 79 insertions, 2 deletions
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 15aeccda388..7727cb5f85c 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -424,6 +424,12 @@ do { \
#define CAN_DEBUG_WITHOUT_FP
/* target machine storage layout */
+typedef struct machine_function GTY(())
+{
+ /* Flag indicating that a .NSUBSPA directive has been output for
+ this function. */
+ int in_nsubspa;
+} machine_function;
/* Define this macro if it is advisable to hold scalars in registers
in a wider mode than that declared by the program. In such cases,
@@ -1524,7 +1530,12 @@ extern int may_call_alloca;
&& (TARGET_NO_SPACE_REGS \
? (base && REG_P (index)) \
: (base == XEXP (X, 1) && REG_P (index) \
- && REG_POINTER (base) && !REG_POINTER (index))) \
+ && (reload_completed \
+ || (reload_in_progress && HARD_REGISTER_P (base)) \
+ || REG_POINTER (base)) \
+ && (reload_completed \
+ || (reload_in_progress && HARD_REGISTER_P (index)) \
+ || !REG_POINTER (index)))) \
&& MODE_OK_FOR_UNSCALED_INDEXING_P (MODE) \
&& REG_OK_FOR_INDEX_P (index) \
&& borx_reg_operand (base, Pmode) \
@@ -1682,12 +1693,78 @@ do { \
goto LABEL
#define TARGET_ASM_SELECT_SECTION pa_select_section
-
+
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
&& DECL_SECTION_NAME (DECL) != NULL_TREE)
+/* The following extra sections and extra section functions are only used
+ for SOM, but they must be provided unconditionally because pa.c's calls
+ to the functions might not get optimized out when other object formats
+ are in use. */
+
+#define EXTRA_SECTIONS \
+ in_som_readonly_data, \
+ in_som_one_only_readonly_data, \
+ in_som_one_only_data
+
+#define EXTRA_SECTION_FUNCTIONS \
+ SOM_READONLY_DATA_SECTION_FUNCTION \
+ SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION \
+ SOM_ONE_ONLY_DATA_SECTION_FUNCTION \
+ FORGET_SECTION_FUNCTION
+
+/* SOM puts readonly data in the default $LIT$ subspace when PIC code
+ is not being generated. */
+#define SOM_READONLY_DATA_SECTION_FUNCTION \
+void \
+som_readonly_data_section (void) \
+{ \
+ if (!TARGET_SOM) \
+ return; \
+ if (in_section != in_som_readonly_data) \
+ { \
+ in_section = in_som_readonly_data; \
+ fputs ("\t.SPACE $TEXT$\n\t.SUBSPA $LIT$\n", asm_out_file); \
+ } \
+}
+
+/* When secondary definitions are not supported, SOM makes readonly data one
+ only by creating a new $LIT$ subspace in $TEXT$ with the comdat flag. */
+#define SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION \
+void \
+som_one_only_readonly_data_section (void) \
+{ \
+ if (!TARGET_SOM) \
+ return; \
+ in_section = in_som_one_only_readonly_data; \
+ fputs ("\t.SPACE $TEXT$\n" \
+ "\t.NSUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16,COMDAT\n",\
+ asm_out_file); \
+}
+
+/* When secondary definitions are not supported, SOM makes data one only by
+ creating a new $DATA$ subspace in $PRIVATE$ with the comdat flag. */
+#define SOM_ONE_ONLY_DATA_SECTION_FUNCTION \
+void \
+som_one_only_data_section (void) \
+{ \
+ if (!TARGET_SOM) \
+ return; \
+ in_section = in_som_one_only_data; \
+ fputs ("\t.SPACE $PRIVATE$\n" \
+ "\t.NSUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31,SORT=24,COMDAT\n", \
+ asm_out_file); \
+}
+
+#define FORGET_SECTION_FUNCTION \
+void \
+forget_section (void) \
+{ \
+ in_section = no_section; \
+}
+
/* Define this macro if references to a symbol must be treated
differently depending on something about the variable or
function named by the symbol (such as what section it is in).