This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/4] Define MAX_CODE_ALIGN globally.
- From: marxin <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Jul 2018 18:03:55 +0200
- Subject: [PATCH 3/4] Define MAX_CODE_ALIGN globally.
- References: <cover.1531730500.git.mliska@suse.cz>
- Resent-user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0
gcc/ChangeLog:
2018-07-11 Martin Liska <mliska@suse.cz>
* align.h (MAX_CODE_ALIGN): New.
(MAX_CODE_ALIGN_VALUE): New.
* common/config/i386/i386-common.c (ix86_handle_option):
(MAX_CODE_ALIGN): Moved to align.h.
* final.c (MAX_CODE_ALIGN): Likewise.
* opts.c (parse_and_check_align_values):
(MAX_CODE_ALIGN): Likewise.
(MAX_CODE_ALIGN_VALUE): Likewise.
---
gcc/align.h | 4 ++++
gcc/common/config/i386/i386-common.c | 3 ---
gcc/final.c | 1 -
gcc/opts.c | 4 ----
4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/gcc/align.h b/gcc/align.h
index 5a5d6c752a3..9acce47cf9b 100644
--- a/gcc/align.h
+++ b/gcc/align.h
@@ -74,3 +74,7 @@ struct align_flags
align_flags_tuple levels[2];
};
+
+/* Define maximum supported code alignment. */
+#define MAX_CODE_ALIGN 16
+#define MAX_CODE_ALIGN_VALUE (1 << MAX_CODE_ALIGN)
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index 277ee55a093..70b3c3f2fc3 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -1318,9 +1318,6 @@ ix86_handle_option (struct gcc_options *opts,
return true;
- /* Comes from final.c -- no real reason to change it. */
-#define MAX_CODE_ALIGN 16
-
case OPT_malign_loops_:
warning_at (loc, 0, "-malign-loops is obsolete, use -falign-loops");
if (value > MAX_CODE_ALIGN)
diff --git a/gcc/final.c b/gcc/final.c
index 59eb75c3d63..445a3fe938a 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -842,7 +842,6 @@ shorten_branches (rtx_insn *first)
rtx_insn *insn;
int max_uid;
int i;
-#define MAX_CODE_ALIGN 16
rtx_insn *seq;
int something_changed = 1;
char *varying_length;
diff --git a/gcc/opts.c b/gcc/opts.c
index e536607fe79..0625b15b27b 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1805,10 +1805,6 @@ parse_and_check_align_values (const char *flag,
return false;
}
- /* Comes from final.c -- no real reason to change it. */
-#define MAX_CODE_ALIGN 16
-#define MAX_CODE_ALIGN_VALUE (1 << MAX_CODE_ALIGN)
-
for (unsigned i = 0; i < result_values.length (); i++)
if (result_values[i] > MAX_CODE_ALIGN_VALUE)
{