summaryrefslogtreecommitdiff
path: root/gcc/opth-gen.awk
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-18 14:52:06 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-18 14:52:06 +0000
commit72ec6882af0cdd2dbb64e0019806cabdd9302b58 (patch)
tree281491eb9469913e27f7aa1d7338b708f181d46f /gcc/opth-gen.awk
parent16a1895e10389a1d54c67d23f32999ac2cbc556d (diff)
downloadgcc-72ec6882af0cdd2dbb64e0019806cabdd9302b58.tar.gz
Allow HOST_WIDE_INT for option variable.
2011-08-18 H.J. Lu <hongjiu.lu@intel.com> Igor Zamyatin <igor.zamyatin@intel.com> * hwint.h (HOST_WIDE_INT_1): New. * opt-functions.awk (switch_bit_fields): Initialize the host_wide_int field. (host_wide_int_var_name): New. (var_type_struct): Check and return HOST_WIDE_INT. * opt-read.awk: Handle HOST_WIDE_INT for "Variable". * optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other. * opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly check masks for HOST_WIDE_INT. * opts-common.c (set_option): Support HOST_WIDE_INT flag_var. (option_enabled): Likewise. (get_option_state): Likewise. * opts.h (cl_option): Add cl_host_wide_int. Change var_value to HOST_WIDE_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opth-gen.awk')
-rw-r--r--gcc/opth-gen.awk12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk
index 876e0f6336e..2bae6953399 100644
--- a/gcc/opth-gen.awk
+++ b/gcc/opth-gen.awk
@@ -300,18 +300,26 @@ for (i = 0; i < n_opts; i++) {
name = opt_args("Mask", flags[i])
vname = var_name(flags[i])
mask = "MASK_"
+ mask_1 = "1"
if (vname != "") {
mask = "OPTION_MASK_"
+ if (host_wide_int[vname] == "yes")
+ mask_1 = "HOST_WIDE_INT_1"
}
if (name != "" && !flag_set_p("MaskExists", flags[i]))
- print "#define " mask name " (1 << " masknum[vname]++ ")"
+ print "#define " mask name " (" mask_1 " << " masknum[vname]++ ")"
}
for (i = 0; i < n_extra_masks; i++) {
print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")"
}
for (var in masknum) {
- if (masknum[var] > 31) {
+ if (var != "" && host_wide_int[var] == "yes") {
+ print" #if defined(HOST_BITS_PER_WIDE_INT) && " masknum[var] " >= HOST_BITS_PER_WIDE_INT"
+ print "#error too many masks for " var
+ print "#endif"
+ }
+ else if (masknum[var] > 31) {
if (var == "")
print "#error too many target masks"
else