patch-gcc_opts_c 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. $OpenBSD: patch-gcc_opts_c,v 1.3 2013/01/16 19:28:48 pascal Exp $
  2. --- gcc/opts.c.orig Thu Feb 17 17:51:57 2011
  3. +++ gcc/opts.c Mon Jan 14 16:07:20 2013
  4. @@ -43,6 +43,9 @@ along with GCC; see the file COPYING3. If not see
  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. @@ -464,7 +467,9 @@ static const struct default_options default_options_ta
  14. { OPT_LEVELS_2_PLUS, OPT_fpartial_inlining, NULL, 1 },
  15. { OPT_LEVELS_2_PLUS, OPT_fthread_jumps, NULL, 1 },
  16. { OPT_LEVELS_2_PLUS, OPT_fcrossjumping, NULL, 1 },
  17. +#ifndef __hppa__
  18. { OPT_LEVELS_2_PLUS, OPT_foptimize_sibling_calls, NULL, 1 },
  19. +#endif
  20. { OPT_LEVELS_2_PLUS, OPT_fcse_follow_jumps, NULL, 1 },
  21. { OPT_LEVELS_2_PLUS, OPT_fgcse, NULL, 1 },
  22. { OPT_LEVELS_2_PLUS, OPT_fexpensive_optimizations, NULL, 1 },
  23. @@ -477,9 +482,9 @@ static const struct default_options default_options_ta
  24. { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
  25. #endif
  26. { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
  27. - { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
  28. - { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
  29. +#ifndef __hppa__
  30. { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
  31. +#endif
  32. { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
  33. { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
  34. { OPT_LEVELS_2_PLUS, OPT_ftree_builtin_call_dce, NULL, 1 },
  35. @@ -494,6 +499,7 @@ static const struct default_options default_options_ta
  36. { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 },
  37. /* -O3 optimizations. */
  38. + { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
  39. { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
  40. { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
  41. /* Inlining of functions reducing size is a good idea with -Os
  42. @@ -691,6 +697,8 @@ finish_options (struct gcc_options *opts, struct gcc_o
  43. if (!opts->x_flag_opts_finished)
  44. {
  45. + if (opts->x_flag_pic || opts->x_profile_flag)
  46. + opts->x_flag_pie = 0;
  47. if (opts->x_flag_pie)
  48. opts->x_flag_pic = opts->x_flag_pie;
  49. if (opts->x_flag_pic && !opts->x_flag_pie)
  50. @@ -1411,6 +1419,11 @@ common_handle_option (struct gcc_options *opts,
  51. case OPT_Wframe_larger_than_:
  52. opts->x_frame_larger_than_size = value;
  53. opts->x_warn_frame_larger_than = value != -1;
  54. + break;
  55. +
  56. + case OPT_Wstack_larger_than_:
  57. + stack_larger_than_size = value;
  58. + warn_stack_larger_than = stack_larger_than_size != -1;
  59. break;
  60. case OPT_Wstrict_aliasing: