コード例 #1
0
ファイル: param_manager.cpp プロジェクト: byu-magicc/fcu_io
bool ParamManager::load_from_file(std::string filename)
{
  try
  {
    YAML::Node root = YAML::LoadFile(filename);
    assert(root.IsSequence());

    for (int i = 0; i < root.size(); i++)
    {
      if (root[i].IsMap() && root[i]["name"] && root[i]["type"] && root[i]["value"])
      {
        if (is_param_id(root[i]["name"].as<std::string>()))
        {
          Param param = params_.find(root[i]["name"].as<std::string>())->second;
          if ((MAV_PARAM_TYPE) root[i]["type"].as<int>() == param.getType())
          {
            set_param_value(root[i]["name"].as<std::string>(), root[i]["value"].as<double>());
          }
        }
      }
    }

    return true;
  }
  catch (...)
  {
    return false;
  }
}
コード例 #2
0
ファイル: net.c プロジェクト: bensteinberg/aleph
void net_set_in_value(s32 inIdx, io_t val) {
  if (inIdx < 0) return;
  if (inIdx < net->numIns) {
    op_set_in_val(net->ops[net->ins[inIdx].opIdx], net->ins[inIdx].opInIdx, val);
  } else {
    // parameter
    inIdx -= net->numIns;
    set_param_value(inIdx, val);
  }
}
コード例 #3
0
ファイル: param.c プロジェクト: nvl1109/em2440iii
/* 
 * Change a value of parameter
 *
 * vivi> param set <name> <value>
 *
 *     set (argv[0]): command of parameter
 *  <name> (argv[1]): name of parameter
 * <value> (argv[2]): value to set
 */
static void command_set(int argc, const char **argv)
{
	int ret;
	char *name;
	param_value_t pre_value, value;


	if (argc != 3) {
		printk("invalid 'param set' command: too few(many) arguments\n");
		return;
	}

	/* parsing arguments */
	name = (char *)argv[1];

	/* if a user want to set the 'linux command line' */
	if (strncmp(name, "linux_cmd_line", strlen(name)) == 0) {
		ret = set_linux_cmd_line(argv[2]);
		if (!ret) {
			printk("Change linux command line to \"%s\"\n", 
				linux_cmd_line);
		} else {
			printk("Failed changing linux command line\n");
		}
		return;
	}

	/* Change normag vivi parameters */
	value = (param_value_t)strtoul(argv[2], NULL, 0, &ret);
	if (ret) {
		printk("Can not parsing arguments\n");
	}

	pre_value = get_param_value(name, &ret);
	ret = set_param_value(name, value);
	if (ret) {
		printk("Error: can not change '%s' parameter value\n", name);
	}
	printk("Change '%s' value. 0x%08lx(%d) to 0x%08lx(%d)\n",
		name, pre_value, pre_value, value, value);
	return;
}
コード例 #4
0
ファイル: safesearch.c プロジェクト: dankamongmen/snare
static int
modify_parameter(char **query, const char *name, const char *value) {
  ParamNodeType *pl = NULL;
  int ret = -1;
  ustring us = USTRING_INITIALIZER;
  char *result;

  pl = parse_params(*query, "&");
  if(!pl) {
    nag("Error parsing query string\n");
    goto cleanup;
  }

  if(set_param_value(&pl, name, value, 0)) {
    nag("Error setting query string value\n");
    goto cleanup;
  }

  if(rebuild_params(pl, &us, "&")) {
    nag("Error rebuilding query string\n");
    goto cleanup;
  }

  result = Strdup(us.string);
  if(!result) {
    goto cleanup;
  }
 
  Free(*query);
  *query = result;

  ret = 0;

 cleanup:
  delete_param_list(pl);
  reset_ustring(&us);
  return ret;
}
コード例 #5
0
ファイル: opts.c プロジェクト: DJHartley/iphone-dev
/* Handle --param NAME=VALUE.  */
static void
handle_param (const char *carg)
{
  char *equal, *arg;
  int value;

  arg = xstrdup (carg);
  equal = strchr (arg, '=');
  if (!equal)
    error ("%s: --param arguments should be of the form NAME=VALUE", arg);
  else
    {
      value = integral_argument (equal + 1);
      if (value == -1)
	error ("invalid --param value %qs", equal + 1);
      else
	{
	  *equal = '\0';
	  set_param_value (arg, value);
	}
    }

  free (arg);
}
コード例 #6
0
ファイル: net.c プロジェクト: bensteinberg/aleph
// activate an input node with a value
void net_activate(s16 inIdx, const io_t val, void* op) {
  static inode_t* pIn;
  s16 pIndex;
  u8 vis;

  print_dbg("\r\n net_activate, input idx: ");
  print_dbg_hex(inIdx);
  print_dbg(" , value: ");
  print_dbg_hex(val);

  print_dbg(" , op index: ");
  print_dbg_ulong(net->ins[inIdx].opIdx);
  print_dbg(" , input idx: ");
  print_dbg_ulong(net->ins[inIdx].opInIdx);

  if(!netActive) {
    if(op != NULL) {
      // if the net isn't active, dont respond to requests from operators
      print_dbg(" ... ignoring node activation from op.");
      return;
    }
  }



  if(inIdx < 0) {
    return;
  }

  vis = net_get_in_play(inIdx);
    print_dbg(" , play visibility flag : ");
    print_dbg_ulong(vis);

  if(inIdx < net->numIns) {      
    // this is an op input
    pIn = &(net->ins[inIdx]);
    
    print_dbg(" ; input node pointer: 0x"); print_dbg_hex((u32)pIn);

    op_set_in_val(net->ops[pIn->opIdx],
		  pIn->opInIdx,
		  val);
    
  } else { 
    // this is a parameter
    //// FIXME this is horrible
    pIndex = inIdx - net->numIns;
    if (pIndex >= net->numParams) { return; }
    print_dbg(" ; param index: 0x"); print_dbg_ulong(pIndex);
    set_param_value(pIndex, val);
  }

  /// only process for play mode if we're in play mode
  if(pageIdx == ePagePlay) {
    print_dbg(" , play mode ");
    if(opPlay) {
      //      operators have focus, do nothing
      print_dbg(" , op focus mode");
    } else {
      // process if play-mode-visibility is set on this input
      if(vis) {
	print_dbg(" , input enabled");
	play_input(inIdx);
      }
    }
  }  
  
}
コード例 #7
0
ファイル: net.c プロジェクト: bensteinberg/aleph
// resend existing parameter values
void net_send_params(void) {
  u32 i;
  for(i=0; i<net->numParams; i++) {
    set_param_value(i, net->params[i].data.value);
  }
}
コード例 #8
0
ファイル: opts.c プロジェクト: DJHartley/iphone-dev
static int
common_handle_option (size_t scode, const char *arg, int value)
{
  enum opt_code code = (enum opt_code) scode;

  switch (code)
    {
    /* APPLE LOCAL begin fat builds */
    case OPT_arch:
      /* Ignore for now. */
      break;
    /* APPLE LOCAL end fat builds */

    case OPT__help:
      print_help ();
      exit_after_options = true;
      break;

    case OPT__param:
      handle_param (arg);
      break;

    case OPT__target_help:
      display_target_options ();
      exit_after_options = true;
      break;

    case OPT__version:
      print_version (stderr, "");
      exit_after_options = true;
      break;

    case OPT_G:
      g_switch_value = value;
      g_switch_set = true;
      break;

    case OPT_O:
    case OPT_Os:
      /* Currently handled in a prescan.  */
      break;

    case OPT_W:
      /* For backward compatibility, -W is the same as -Wextra.  */
      set_Wextra (value);
      break;

    case OPT_Wextra:
      set_Wextra (value);
      break;

    case OPT_Wlarger_than_:
      larger_than_size = value;
      warn_larger_than = value != -1;
      break;

    case OPT_Wstrict_aliasing:
    case OPT_Wstrict_aliasing_:
      warn_strict_aliasing = value;
      break;

    case OPT_Wunused:
      set_Wunused (value);
      break;

    case OPT_aux_info:
    case OPT_aux_info_:
      aux_info_file_name = arg;
      flag_gen_aux_info = 1;
      break;

    case OPT_auxbase:
      aux_base_name = arg;
      break;
      
      /* APPLE LOCAL begin LLVM */
    case OPT_mllvm:
      llvm_optns = arg;
      break;
      /* APPLE LOCAL end LLVM */

    case OPT_auxbase_strip:
      {
	char *tmp = xstrdup (arg);
	strip_off_ending (tmp, strlen (tmp));
	if (tmp[0])
	  aux_base_name = tmp;
      }
      break;

    case OPT_d:
      decode_d_option (arg);
      break;

    case OPT_dumpbase:
      dump_base_name = arg;
      break;

/* APPLE LOCAL begin optimization pragmas 3124235/3420242 */
/* APPLE LOCAL end optimization pragmas 3124235/3420242 */
    /* APPLE LOCAL begin falign-jumps-max-skip */
    case OPT_falign_jumps_max_skip_:
      align_jumps_max_skip = value;
      break;

    case OPT_falign_loops_max_skip_:
      align_loops_max_skip = value;
      break;
    /* APPLE LOCAL end falign-jumps-max-skip */

/* APPLE LOCAL begin optimization pragmas 3124235/3420242 */
/* APPLE LOCAL end optimization pragmas 3124235/3420242 */
    /* APPLE LOCAL begin predictive compilation */
    case OPT_fpredictive_compilation:
      predictive_compilation = 0;
      break;

    case OPT_fpredictive_compilation_:
      {
	char* buf = xmalloc (strlen(arg) + 1);
	sprintf (buf, "%d", value);
	if (strcmp(buf, arg))
	  {
	    error ("argument to \"-fpredictive-compilation=\" should be a valid non-negative integer instead of \"%s\"", arg);
	    value = 0;
	  }
	free(buf);
        predictive_compilation = value;
        break;
      }
    /* APPLE LOCAL end predictive compilation */

    case OPT_fbranch_probabilities:
      flag_branch_probabilities_set = true;
      break;

    case OPT_fcall_used_:
      fix_register (arg, 0, 1);
      break;

    case OPT_fcall_saved_:
      fix_register (arg, 0, 0);
      break;

    case OPT_fdiagnostics_show_location_:
      if (!strcmp (arg, "once"))
	diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
      else if (!strcmp (arg, "every-line"))
	diagnostic_prefixing_rule (global_dc)
	  = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE;
      else
	return 0;
      break;

    case OPT_fdump_:
      if (!dump_switch_p (arg))
	return 0;
      break;

    case OPT_ffast_math:
      set_fast_math_flags (value);
      break;

    case OPT_ffixed_:
      fix_register (arg, 1, 1);
      break;

    case OPT_finline_limit_:
    case OPT_finline_limit_eq:
      set_param_value ("max-inline-insns-single", value / 2);
      set_param_value ("max-inline-insns-auto", value / 2);
      break;

    case OPT_fmessage_length_:
      pp_set_line_maximum_length (global_dc->printer, value);
      break;

    case OPT_fpack_struct_:
      if (value <= 0 || (value & (value - 1)) || value > 16)
	error("structure alignment must be a small power of two, not %d", value);
      else
	{
	  initial_max_fld_align = value;
	  maximum_field_alignment = value * BITS_PER_UNIT;
	}
      break;

    case OPT_fpeel_loops:
      flag_peel_loops_set = true;
      break;

    case OPT_fprofile_arcs:
      profile_arc_flag_set = true;
      break;

    /* APPLE LOCAL begin add fuse-profile */
    case OPT_fuse_profile:
    /* APPLE LOCAL end add fuse-profile */
    case OPT_fprofile_use:
      if (!flag_branch_probabilities_set)
        flag_branch_probabilities = value;
      if (!flag_profile_values_set)
        flag_profile_values = value;
      if (!flag_unroll_loops_set)
        flag_unroll_loops = value;
      if (!flag_peel_loops_set)
        flag_peel_loops = value;
      if (!flag_tracer_set)
        flag_tracer = value;
      if (!flag_value_profile_transformations_set)
        flag_value_profile_transformations = value;
#ifdef HAVE_prefetch
      if (0 && !flag_speculative_prefetching_set)
	flag_speculative_prefetching = value;
#endif
      break;

    /* APPLE LOCAL begin add fcreate-profile */
    case OPT_fcreate_profile:
    /* APPLE LOCAL end add fcreate-profile */
    case OPT_fprofile_generate:
      if (!profile_arc_flag_set)
        profile_arc_flag = value;
      if (!flag_profile_values_set)
        flag_profile_values = value;
      if (!flag_value_profile_transformations_set)
        flag_value_profile_transformations = value;
      if (!flag_unroll_loops_set)
	flag_unroll_loops = value;
#ifdef HAVE_prefetch
      if (0 && !flag_speculative_prefetching_set)
	flag_speculative_prefetching = value;
#endif
      break;

    case OPT_fprofile_values:
      flag_profile_values_set = true;
      break;

    case OPT_fvisibility_:
      {
        if (!strcmp(arg, "default"))
          default_visibility = VISIBILITY_DEFAULT;
        else if (!strcmp(arg, "internal"))
          default_visibility = VISIBILITY_INTERNAL;
        else if (!strcmp(arg, "hidden"))
          default_visibility = VISIBILITY_HIDDEN;
        else if (!strcmp(arg, "protected"))
          default_visibility = VISIBILITY_PROTECTED;
        else
          error ("unrecognised visibility value \"%s\"", arg);
      }
      break;

    case OPT_fvpt:
      flag_value_profile_transformations_set = true;
      break;

    case OPT_fspeculative_prefetching:
      flag_speculative_prefetching_set = true;
      break;

    case OPT_frandom_seed:
      /* The real switch is -fno-random-seed.  */
      if (value)
	return 0;
      flag_random_seed = NULL;
      break;

    case OPT_frandom_seed_:
      flag_random_seed = arg;
      break;

/* APPLE LOCAL begin optimization pragmas 3124235/3420242 */
/* APPLE LOCAL end optimization pragmas 3124235/3420242 */

    case OPT_fsched_stalled_insns_:
      flag_sched_stalled_insns = value;
      if (flag_sched_stalled_insns == 0)
	flag_sched_stalled_insns = -1;
      break;

/* APPLE LOCAL begin optimization pragmas 3124235/3420242 */
/* APPLE LOCAL end optimization pragmas 3124235/3420242 */

    case OPT_fstack_limit:
      /* The real switch is -fno-stack-limit.  */
      if (value)
	return 0;
      stack_limit_rtx = NULL_RTX;
      break;

    case OPT_fstack_limit_register_:
      {
	int reg = decode_reg_name (arg);
	if (reg < 0)
	  error ("unrecognized register name \"%s\"", arg);
	else
	  stack_limit_rtx = gen_rtx_REG (Pmode, reg);
      }
      break;

    case OPT_fstack_limit_symbol_:
      stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (arg));
      break;

    case OPT_ftree_vectorizer_verbose_:
      vect_set_verbosity_level (arg);
      break;

    case OPT_ftls_model_:
      if (!strcmp (arg, "global-dynamic"))
	flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
      else if (!strcmp (arg, "local-dynamic"))
	flag_tls_default = TLS_MODEL_LOCAL_DYNAMIC;
      else if (!strcmp (arg, "initial-exec"))
	flag_tls_default = TLS_MODEL_INITIAL_EXEC;
      else if (!strcmp (arg, "local-exec"))
	flag_tls_default = TLS_MODEL_LOCAL_EXEC;
      else
	warning ("unknown tls-model \"%s\"", arg);
      break;

    case OPT_ftracer:
      flag_tracer_set = true;
      break;

    case OPT_funroll_loops:
      flag_unroll_loops_set = true;
      break;

      /* APPLE LOCAL begin fwritable strings  */
    case OPT_fwritable_strings:
      flag_writable_strings = value;
      break;
      /* APPLE LOCAL end fwritable strings  */

    case OPT_g:
      set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg);
      break;

    case OPT_gcoff:
      set_debug_level (SDB_DEBUG, false, arg);
      break;

    case OPT_gdwarf_2:
      set_debug_level (DWARF2_DEBUG, false, arg);
      break;

    case OPT_ggdb:
      set_debug_level (NO_DEBUG, 2, arg);
      break;

    case OPT_gstabs:
    case OPT_gstabs_:
      set_debug_level (DBX_DEBUG, code == OPT_gstabs_, arg);
      break;

    case OPT_gvms:
      set_debug_level (VMS_DEBUG, false, arg);
      break;

    case OPT_gxcoff:
    case OPT_gxcoff_:
      set_debug_level (XCOFF_DEBUG, code == OPT_gxcoff_, arg);
      break;

    case OPT_m:
      set_target_switch (arg);
      break;

    case OPT_o:
      asm_file_name = arg;
      break;

    case OPT_pedantic_errors:
      flag_pedantic_errors = pedantic = 1;
      break;

    default:
      /* If the flag was handled in a standard way, assume the lack of
	 processing here is intentional.  */
      /* APPLE LOCAL optimization pragmas 3124235/3420242 */
      if (cl_options[scode].flag_var || cl_options[scode].access_flag)
	break;

      abort ();
    }

  return 1;
}
コード例 #9
0
ファイル: opts.c プロジェクト: DJHartley/iphone-dev
void set_flags_from_O (unsigned int cmdline)
{
  /* Reset flags to the "raw" state before command line processing,
     except for optimize and optimize_size.  */
  int save_optimize_size = optimize_size;
  int save_optimize = optimize;
  cl_pf_opts = cl_pf_opts_raw;
  optimize = save_optimize;
  optimize_size = save_optimize_size;

  if (!optimize)
    {
      if (cmdline)
	flag_merge_constants = 0;
    }

  if (optimize >= 1)
    {
      flag_defer_pop = 1;
#ifdef DELAY_SLOTS
      flag_delayed_branch = 1;
#endif
#ifdef CAN_DEBUG_WITHOUT_FP
      flag_omit_frame_pointer = 1;
#endif
      flag_guess_branch_prob = 1;
      flag_cprop_registers = 1;
      flag_loop_optimize = 1;
      flag_if_conversion = 1;
      flag_if_conversion2 = 1;
      flag_tree_ccp = 1;
      flag_tree_dce = 1;
      flag_tree_dom = 1;
      flag_tree_dse = 1;
      /* APPLE LOCAL begin lno */
      flag_tree_loop_im = 1;
      flag_ivopts = 1;
      flag_tree_vectorize = 0;
      flag_tree_loop_linear = 0;
      flag_tree_pre = 1;
      /* APPLE LOCAL end lno */
      flag_tree_ter = 1;
      flag_tree_live_range_split = 1;
      flag_tree_sra = 1;
      flag_tree_copyrename = 1;
      flag_tree_fre = 1;
      /* APPLE LOCAL begin mainline 4840357 */
      if (!no_unit_at_a_time_default)
        flag_unit_at_a_time = 1;
      /* APPLE LOCAL end mainline 4840357 */

      if (!optimize_size)
	{
	  /* Loop header copying usually increases size of the code.  This used
	     not to be true, since quite often it is possible to verify that
	     the condition is satisfied in the first iteration and therefore
	     to eliminate it.  Jump threading handles these cases now.  */
	  flag_tree_ch = 1;
	}
    }

  if (optimize >= 2)
    {
      flag_thread_jumps = 1;
      flag_crossjumping = 1;
      flag_optimize_sibling_calls = 1;
      flag_cse_follow_jumps = 1;
      flag_cse_skip_blocks = 1;
      flag_gcse = 1;
      flag_expensive_optimizations = 1;
      flag_strength_reduce = 1;
      flag_rerun_cse_after_loop = 1;
      flag_rerun_loop_opt = 1;
      flag_caller_saves = 1;
/* APPLE LOCAL begin radar 4153339 */
/** Removed - Note! Mainline will removed the entire -fforce-mem functionality.
      flag_force_mem = 1;
*/
/* APPLE LOCAL end radar 4153339 */
      flag_peephole2 = 1;
#ifdef INSN_SCHEDULING
      flag_schedule_insns = 1;
      flag_schedule_insns_after_reload = 1;
#endif
      flag_regmove = 1;
      flag_delete_null_pointer_checks = 1;
      flag_reorder_blocks = 1;
      if (cmdline)
	{
	  flag_strict_aliasing = 1;
	  flag_reorder_functions = 1;
	  /* APPLE LOCAL begin mainline deletion 4840357 */
	  /* APPLE LOCAL end mainline deletion 4840357 */
	}

      if (!optimize_size)
	{
          /* PRE tends to generate bigger code.  */
          flag_tree_pre = 1;
	}
      /* APPLE LOCAL begin LLVM */
      /* Enable loop unrolling at -O2 if -f[no-]unroll-loops is not used.  */
      if (!flag_unroll_loops_set && !optimize_size)
        flag_unroll_loops = 1;
      /* APPLE LOCAL end LLVM */
    }

  if (optimize >= 3)
    {
      if (cmdline)
        flag_inline_functions = 1;
      flag_unswitch_loops = 1;
      flag_gcse_after_reload = 1;
    }

  if (optimize < 2 || optimize_size)
    {
      align_loops = 1;
      align_jumps = 1;
      align_labels = 1;
      if (cmdline)
        align_functions = 1;

      /* Don't reorder blocks when optimizing for size because extra
	 jump insns may be created; also barrier may create extra padding.

	 More correctly we should have a block reordering mode that tried
	 to minimize the combined size of all the jumps.  This would more
	 or less automatically remove extra jumps, but would also try to
	 use more short jumps instead of long jumps.  */
      flag_reorder_blocks = 0;
      flag_reorder_blocks_and_partition = 0;
    }

  if (optimize_size)
    {
      if (cmdline)
	{
          /* APPLE LOCAL begin 4200438, 4209014 */
	  /* Set inlining heuristic at 450 for C and ObjC; 30 for every other language.  */
	  int estimated_insns =  (!strcmp (lang_hooks.name, "GNU C")
				  || !strcmp (lang_hooks.name, "GNU Objective-C"))
	    ? 450 : 30;
	  /* Inlining of very small functions usually reduces total size.  */
	  set_param_value ("max-inline-insns-single", estimated_insns);
	  set_param_value ("max-inline-insns-auto", 30);
	  /* APPLE LOCAL end 4200438, 4209014 */
					
	  flag_inline_functions = 1;

	  /* We want to crossjump as much as possible.  */
	  set_param_value ("min-crossjump-insns", 1);
	}
    }
}
コード例 #10
0
ファイル: opts.c プロジェクト: svn2github/open64
/* Parse command line options and set default flag values.  Do minimal
   options processing.  */
void
decode_options (unsigned int argc, const char **argv)
{
  unsigned int i, lang_mask;

  /* Perform language-specific options initialization.  */
  lang_mask = lang_hooks.init_options (argc, argv);

  lang_hooks.initialize_diagnostics (global_dc);

  /* Scan to see what optimization level has been specified.  That will
     determine the default value of many flags.  */
  for (i = 1; i < argc; i++)
    {
      if (!strcmp (argv[i], "-O"))
	{
	  optimize = 1;
	  optimize_size = 0;
	}
      else if (argv[i][0] == '-' && argv[i][1] == 'O')
	{
	  /* Handle -Os, -O2, -O3, -O69, ...  */
	  const char *p = &argv[i][2];

	  if ((p[0] == 's') && (p[1] == 0))
	    {
	      optimize_size = 1;

	      /* Optimizing for size forces optimize to be 2.  */
	      optimize = 2;
	    }
	  else
	    {
	      const int optimize_val = read_integral_parameter (p, p - 2, -1);
	      if (optimize_val != -1)
		{
		  optimize = optimize_val;
		  optimize_size = 0;
		}
	    }
	}
    }

  if (!optimize)
    {
      flag_merge_constants = 0;
    }

  if (optimize >= 1)
    {
      flag_defer_pop = 1;
#ifdef DELAY_SLOTS
      flag_delayed_branch = 1;
#endif
#ifdef CAN_DEBUG_WITHOUT_FP
      flag_omit_frame_pointer = 1;
#endif
      flag_guess_branch_prob = 1;
      flag_cprop_registers = 1;
      flag_loop_optimize = 1;
      flag_if_conversion = 1;
      flag_if_conversion2 = 1;
      flag_tree_ccp = 1;
      flag_tree_dce = 1;
      flag_tree_dom = 1;
      flag_tree_dse = 1;
      flag_tree_ter = 1;
      flag_tree_live_range_split = 1;
      flag_tree_sra = 1;
      flag_tree_copyrename = 1;
      flag_tree_fre = 1;

      if (!optimize_size)
	{
	  /* Loop header copying usually increases size of the code.  This used
	     not to be true, since quite often it is possible to verify that
	     the condition is satisfied in the first iteration and therefore
	     to eliminate it.  Jump threading handles these cases now.  */
	  flag_tree_ch = 1;
	}
    }

  if (optimize >= 2)
    {
      flag_thread_jumps = 1;
      flag_crossjumping = 1;
      flag_optimize_sibling_calls = 1;
      flag_cse_follow_jumps = 1;
      flag_cse_skip_blocks = 1;
      flag_gcse = 1;
      flag_expensive_optimizations = 1;
      flag_strength_reduce = 1;
      flag_rerun_cse_after_loop = 1;
      flag_rerun_loop_opt = 1;
      flag_caller_saves = 1;
      flag_force_mem = 1;
      flag_peephole2 = 1;
#ifdef INSN_SCHEDULING
      flag_schedule_insns = 1;
      flag_schedule_insns_after_reload = 1;
#endif
      flag_regmove = 1;
      flag_strict_aliasing = 1;
      flag_delete_null_pointer_checks = 1;
      flag_reorder_blocks = 1;
      flag_reorder_functions = 1;
      flag_unit_at_a_time = 1;

      if (!optimize_size)
	{
          /* PRE tends to generate bigger code.  */
          flag_tree_pre = 1;
	}
    }

  if (optimize >= 3)
    {
      flag_inline_functions = 1;
      flag_unswitch_loops = 1;
      flag_gcse_after_reload = 1;
    }

  if (optimize < 2 || optimize_size)
    {
      align_loops = 1;
      align_jumps = 1;
      align_labels = 1;
      align_functions = 1;

      /* Don't reorder blocks when optimizing for size because extra
	 jump insns may be created; also barrier may create extra padding.

	 More correctly we should have a block reordering mode that tried
	 to minimize the combined size of all the jumps.  This would more
	 or less automatically remove extra jumps, but would also try to
	 use more short jumps instead of long jumps.  */
      flag_reorder_blocks = 0;
      flag_reorder_blocks_and_partition = 0;
    }

  if (optimize_size)
    {
      /* Inlining of very small functions usually reduces total size.  */
      set_param_value ("max-inline-insns-single", 5);
      set_param_value ("max-inline-insns-auto", 5);
      flag_inline_functions = 1;

      /* We want to crossjump as much as possible.  */
      set_param_value ("min-crossjump-insns", 1);
    }

  /* Initialize whether `char' is signed.  */
  flag_signed_char = DEFAULT_SIGNED_CHAR;
  /* Set this to a special "uninitialized" value.  The actual default is set
     after target options have been processed.  */
  flag_short_enums = 2;

  /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
     modify it.  */
  target_flags = 0;
  set_target_switch ("");

  /* Unwind tables are always present when a target has ABI-specified unwind
     tables, so the default should be ON.  */
#ifdef TARGET_UNWIND_INFO
  flag_unwind_tables = TARGET_UNWIND_INFO;
#endif

#ifdef OPTIMIZATION_OPTIONS
  /* Allow default optimizations to be specified on a per-machine basis.  */
  OPTIMIZATION_OPTIONS (optimize, optimize_size);
#endif

  handle_options (argc, argv, lang_mask);

  if (flag_pie)
    flag_pic = flag_pie;
  if (flag_pic && !flag_pie)
    flag_shlib = 1;

  if (flag_no_inline == 2)
    flag_no_inline = 0;
  else
    flag_really_no_inline = flag_no_inline;

  /* Set flag_no_inline before the post_options () hook.  The C front
     ends use it to determine tree inlining defaults.  FIXME: such
     code should be lang-independent when all front ends use tree
     inlining, in which case it, and this condition, should be moved
     to the top of process_options() instead.  */
  if (optimize == 0)
    {
      /* Inlining does not work if not optimizing,
	 so force it not to be done.  */
      flag_no_inline = 1;
      warn_inline = 0;

      /* The c_decode_option function and decode_option hook set
	 this to `2' if -Wall is used, so we can avoid giving out
	 lots of errors for people who don't realize what -Wall does.  */
      if (warn_uninitialized == 1)
	warning ("-Wuninitialized is not supported without -O");
    }

  if (flag_really_no_inline == 2)
    flag_really_no_inline = flag_no_inline;

  /* The optimization to partition hot and cold basic blocks into separate
     sections of the .o and executable files does not work (currently)
     with exception handling.  If flag_exceptions is turned on we need to
     turn off the partitioning optimization.  */

  if (flag_exceptions && flag_reorder_blocks_and_partition)
    {
      warning 
	    ("-freorder-blocks-and-partition does not work with exceptions");
      flag_reorder_blocks_and_partition = 0;
      flag_reorder_blocks = 1;
    }

  /* The optimization to partition hot and cold basic blocks into
     separate sections of the .o and executable files does not currently
     work correctly with DWARF debugging turned on.  Until this is fixed
     we will disable the optimization when DWARF debugging is set.  */
  
  if (flag_reorder_blocks_and_partition && write_symbols == DWARF2_DEBUG)
    {
      warning
	("-freorder-blocks-and-partition does not work with -g (currently)");
      flag_reorder_blocks_and_partition = 0;
      flag_reorder_blocks = 1;
    }
}