summaryrefslogtreecommitdiff
path: root/gcc/config/s390/s390.c
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-09 16:27:15 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-09 16:27:15 +0000
commit6d0afa28716e6b5b437e284572ca11057b350886 (patch)
tree5a1189ff6ceb006e0e8f15ce88cec1110ea73702 /gcc/config/s390/s390.c
parentebfb6092c087ec8946ca5a8a1b39b4ec68a82c37 (diff)
downloadgcc-6d0afa28716e6b5b437e284572ca11057b350886.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170821 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r--gcc/config/s390/s390.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3e6edb76b47..54632ddf9d6 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)
{