aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2011-03-09 16:27:15 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2011-03-09 16:27:15 +0000
commit5d304e47bc76ca92c3c9ae178a183f411f051fc3 (patch)
tree5a1189ff6ceb006e0e8f15ce88cec1110ea73702
parent9b4166b297a6d240e02c165b1890b42b21cc380f (diff)
downloadgcc-5d304e47bc76ca92c3c9ae178a183f411f051fc3.zip
gcc-5d304e47bc76ca92c3c9ae178a183f411f051fc3.tar.gz
gcc-5d304e47bc76ca92c3c9ae178a183f411f051fc3.tar.bz2
s390-protos.h (s390_label_align): New prototype.
2011-03-09 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * config/s390/s390-protos.h (s390_label_align): New prototype. * config/s390/s390.c (s390_label_align): New function. * config/s390/s390.h (LABEL_ALIGN): New target macro definition. From-SVN: r170821
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/s390/s390-protos.h1
-rw-r--r--gcc/config/s390/s390.c26
-rw-r--r--gcc/config/s390/s390.h3
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a92e4a6..147e7ef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-09 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390-protos.h (s390_label_align): New prototype.
+ * config/s390/s390.c (s390_label_align): New function.
+ * config/s390/s390.h (LABEL_ALIGN): New target macro definition.
+
2011-03-08 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/47755
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index 9464879..1df176e 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -101,6 +101,7 @@ extern void s390_split_access_reg (rtx, rtx *, rtx *);
extern void print_operand_address (FILE *, rtx);
extern void print_operand (FILE *, rtx, int);
extern void s390_output_pool_entry (rtx, enum machine_mode, unsigned int);
+extern int s390_label_align (rtx);
extern int s390_agen_dep_p (rtx, rtx);
extern rtx s390_load_got (void);
extern rtx s390_get_thread_pointer (void);
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3e6edb7..54632dd 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -384,6 +384,32 @@ struct GTY(()) machine_function
bytes on a z10 (or higher) CPU. */
#define PREDICT_DISTANCE (TARGET_Z10 ? 384 : 2048)
+/* Return the alignment for LABEL. We default to the -falign-labels
+ value except for the literal pool base label. */
+int
+s390_label_align (rtx label)
+{
+ rtx prev_insn = prev_active_insn (label);
+
+ if (prev_insn == NULL_RTX)
+ goto old;
+
+ prev_insn = single_set (prev_insn);
+
+ if (prev_insn == NULL_RTX)
+ goto old;
+
+ prev_insn = SET_SRC (prev_insn);
+
+ /* Don't align literal pool base labels. */
+ if (GET_CODE (prev_insn) == UNSPEC
+ && XINT (prev_insn, 1) == UNSPEC_MAIN_BASE)
+ return 0;
+
+ old:
+ return align_labels_log;
+}
+
static enum machine_mode
s390_libgcc_cmp_return_mode (void)
{
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 105f5aa..ec395e2 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -870,6 +870,9 @@ do { \
/* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
#define LOCAL_LABEL_PREFIX "."
+#define LABEL_ALIGN(LABEL) \
+ s390_label_align (LABEL)
+
/* How to refer to registers in assembler output. This sequence is
indexed by compiler's hard-register-number (see above). */
#define REGISTER_NAMES \