diff options
author | Richard Guenther <rguenther@suse.de> | 2009-10-13 12:42:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-10-13 12:42:30 +0000 |
commit | ab6218f150a207398a27d1e8bbc0249ac8c03466 (patch) | |
tree | 90f56c87befc608827ef1174d7c38c88631870a2 /gcc/opts.c | |
parent | b02a92ce3e51af8fa68748816c0e7aec1ea86bc6 (diff) | |
download | gcc-ab6218f150a207398a27d1e8bbc0249ac8c03466.zip gcc-ab6218f150a207398a27d1e8bbc0249ac8c03466.tar.gz gcc-ab6218f150a207398a27d1e8bbc0249ac8c03466.tar.bz2 |
re PR lto/41565 (-m32 causes an ICE when the object files were compiled with 64bit)
2009-10-13 Richard Guenther <rguenther@suse.de>
PR lto/41565
* opts.c (handle_option): Split out code to handle setting
the options flag var ...
(set_option): ... here.
* opts.h (set_option): Declare.
* lto-opts.c (register_user_option_p): Include -fexceptions
and all position independent code variants.
(handle_common_option): Remove.
(lto_reissue_options): Use set_option.
From-SVN: r152705
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 63 |
1 files changed, 37 insertions, 26 deletions
@@ -610,32 +610,7 @@ handle_option (const char **argv, unsigned int lang_mask) } if (option->flag_var) - switch (option->var_type) - { - case CLVC_BOOLEAN: - *(int *) option->flag_var = value; - break; - - case CLVC_EQUAL: - *(int *) option->flag_var = (value - ? option->var_value - : !option->var_value); - break; - - case CLVC_BIT_CLEAR: - case CLVC_BIT_SET: - if ((value != 0) == (option->var_type == CLVC_BIT_SET)) - *(int *) option->flag_var |= option->var_value; - else - *(int *) option->flag_var &= ~option->var_value; - if (option->flag_var == &target_flags) - target_flags_explicit |= option->var_value; - break; - - case CLVC_STRING: - *(const char **) option->flag_var = arg; - break; - } + set_option (option, value, arg); if (option->flags & lang_mask) { @@ -2349,6 +2324,42 @@ get_option_state (int option, struct cl_option_state *state) return true; } +/* Set *OPTION according to VALUE and ARG. */ + +void +set_option (const struct cl_option *option, int value, const char *arg) +{ + if (!option->flag_var) + return; + + switch (option->var_type) + { + case CLVC_BOOLEAN: + *(int *) option->flag_var = value; + break; + + case CLVC_EQUAL: + *(int *) option->flag_var = (value + ? option->var_value + : !option->var_value); + break; + + case CLVC_BIT_CLEAR: + case CLVC_BIT_SET: + if ((value != 0) == (option->var_type == CLVC_BIT_SET)) + *(int *) option->flag_var |= option->var_value; + else + *(int *) option->flag_var &= ~option->var_value; + if (option->flag_var == &target_flags) + target_flags_explicit |= option->var_value; + break; + + case CLVC_STRING: + *(const char **) option->flag_var = arg; + break; + } +} + /* Enable a warning option as an error. This is used by -Werror= and also by legacy Werror-implicit-function-declaration. */ |