OSDN Git Service

gcc/fortran/
[pf3gnuchains/gcc-fork.git] / gcc / opts-common.c
index 973dd7e..354bce0 100644 (file)
@@ -304,6 +304,8 @@ generate_canonical_option (size_t opt_index, const char *arg, int value,
          decoded->canonical_option[0] = concat (opt_text, arg, NULL);
          decoded->canonical_option[1] = NULL;
          decoded->canonical_option_num_elements = 1;
+         if (opt_text != option->opt_text)
+           free (CONST_CAST (char *, opt_text));
        }
     }
   else
@@ -878,9 +880,6 @@ handle_option (struct gcc_options *opts,
                                            lang_mask, kind, loc,
                                            handlers, dc))
          return false;
-       else
-         handlers->post_handling_callback (decoded,
-                                           handlers->handlers[i].mask);
       }
   
   return true;
@@ -1088,9 +1087,14 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set,
        break;
 
     case CLVC_EQUAL:
-       *(int *) flag_var = (value
-                            ? option->var_value
-                            : !option->var_value);
+       if (option->cl_host_wide_int) 
+         *(HOST_WIDE_INT *) flag_var = (value
+                                        ? option->var_value
+                                        : !option->var_value);
+       else
+         *(int *) flag_var = (value
+                              ? option->var_value
+                              : !option->var_value);
        if (set_flag_var)
          *(int *) set_flag_var = 1;
        break;
@@ -1098,11 +1102,26 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set,
     case CLVC_BIT_CLEAR:
     case CLVC_BIT_SET:
        if ((value != 0) == (option->var_type == CLVC_BIT_SET))
-         *(int *) flag_var |= option->var_value;
+         {
+           if (option->cl_host_wide_int) 
+             *(HOST_WIDE_INT *) flag_var |= option->var_value;
+           else 
+             *(int *) flag_var |= option->var_value;
+         }
        else
-         *(int *) flag_var &= ~option->var_value;
+         {
+           if (option->cl_host_wide_int) 
+             *(HOST_WIDE_INT *) flag_var &= ~option->var_value;
+           else 
+             *(int *) flag_var &= ~option->var_value;
+         }
        if (set_flag_var)
-         *(int *) set_flag_var |= option->var_value;
+         {
+           if (option->cl_host_wide_int) 
+             *(HOST_WIDE_INT *) set_flag_var |= option->var_value;
+           else
+             *(int *) set_flag_var |= option->var_value;
+         }
        break;
 
     case CLVC_STRING:
@@ -1173,13 +1192,22 @@ option_enabled (int opt_idx, void *opts)
        return *(int *) flag_var != 0;
 
       case CLVC_EQUAL:
-       return *(int *) flag_var == option->var_value;
+       if (option->cl_host_wide_int) 
+         return *(HOST_WIDE_INT *) flag_var == option->var_value;
+       else
+         return *(int *) flag_var == option->var_value;
 
       case CLVC_BIT_CLEAR:
-       return (*(int *) flag_var & option->var_value) == 0;
+       if (option->cl_host_wide_int) 
+         return (*(HOST_WIDE_INT *) flag_var & option->var_value) == 0;
+       else
+         return (*(int *) flag_var & option->var_value) == 0;
 
       case CLVC_BIT_SET:
-       return (*(int *) flag_var & option->var_value) != 0;
+       if (option->cl_host_wide_int) 
+         return (*(HOST_WIDE_INT *) flag_var & option->var_value) != 0;
+       else 
+         return (*(int *) flag_var & option->var_value) != 0;
 
       case CLVC_STRING:
       case CLVC_ENUM:
@@ -1206,7 +1234,9 @@ get_option_state (struct gcc_options *opts, int option,
     case CLVC_BOOLEAN:
     case CLVC_EQUAL:
       state->data = flag_var;
-      state->size = sizeof (int);
+      state->size = (cl_options[option].cl_host_wide_int
+                    ? sizeof (HOST_WIDE_INT)
+                    : sizeof (int));
       break;
 
     case CLVC_BIT_CLEAR: