patch-gcc_opts_c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. $OpenBSD: patch-gcc_opts_c,v 1.3 2015/02/03 20:32:12 pascal Exp $
  2. --- gcc/opts.c.orig Thu Oct 16 15:49:11 2014
  3. +++ gcc/opts.c Sun Feb 1 19:27:27 2015
  4. @@ -50,6 +50,9 @@ const char *const debug_type_names[] =
  5. ((strncmp (prefix, string, sizeof prefix - 1) == 0) \
  6. ? ((string += sizeof prefix - 1), 1) : 0)
  7. +int warn_stack_larger_than;
  8. +HOST_WIDE_INT stack_larger_than_size;
  9. +
  10. void
  11. set_struct_debug_option (struct gcc_options *opts, location_t loc,
  12. const char *spec)
  13. @@ -476,8 +479,6 @@ static const struct default_options default_options_ta
  14. { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_fschedule_insns, NULL, 1 },
  15. { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
  16. #endif
  17. - { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
  18. - { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
  19. { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
  20. { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
  21. { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
  22. @@ -499,6 +500,7 @@ static const struct default_options default_options_ta
  23. { OPT_LEVELS_2_PLUS, OPT_fisolate_erroneous_paths_dereference, NULL, 1 },
  24. /* -O3 optimizations. */
  25. + { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
  26. { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
  27. { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
  28. /* Inlining of functions reducing size is a good idea with -Os
  29. @@ -716,6 +718,8 @@ finish_options (struct gcc_options *opts, struct gcc_o
  30. if (!opts->x_flag_opts_finished)
  31. {
  32. + if (opts->x_flag_pic || opts->x_profile_flag)
  33. + opts->x_flag_pie = 0;
  34. if (opts->x_flag_pie)
  35. opts->x_flag_pic = opts->x_flag_pie;
  36. if (opts->x_flag_pic && !opts->x_flag_pie)
  37. @@ -1584,6 +1588,11 @@ common_handle_option (struct gcc_options *opts,
  38. case OPT_Wframe_larger_than_:
  39. opts->x_frame_larger_than_size = value;
  40. opts->x_warn_frame_larger_than = value != -1;
  41. + break;
  42. +
  43. + case OPT_Wstack_larger_than_:
  44. + stack_larger_than_size = value;
  45. + warn_stack_larger_than = stack_larger_than_size != -1;
  46. break;
  47. case OPT_Wstack_usage_: