Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 621036
Collapse All | Expand All

(-)a/gcc/c-family/c-cppbuiltin.c (-3 / +9 lines)
Lines 576-585 c_cpp_builtins_optimize_pragma (cpp_reader *pfile, tree prev_tree, Link Here
576
  else if (prev->x_optimize_size && !cur->x_optimize_size)
576
  else if (prev->x_optimize_size && !cur->x_optimize_size)
577
    cpp_undef (pfile, "__OPTIMIZE_SIZE__");
577
    cpp_undef (pfile, "__OPTIMIZE_SIZE__");
578
578
579
  if (!prev->x_optimize && cur->x_optimize)
579
  if (!prev->x_optimize && cur->x_optimize) {
580
    cpp_define (pfile, "__OPTIMIZE__");
580
    cpp_define (pfile, "__OPTIMIZE__");
581
  else if (prev->x_optimize && !cur->x_optimize)
581
    cpp_define (pfile, "_FORTIFY_SOURCE=(__OPTIMIZE__ > 0 ? 2 : 0)");
582
  } else if (prev->x_optimize && !cur->x_optimize) {
582
    cpp_undef (pfile, "__OPTIMIZE__");
583
    cpp_undef (pfile, "__OPTIMIZE__");
584
    cpp_undef (pfile, "_FORTIFY_SOURCE");
585
  }
583
586
584
  prev_fast_math = fast_math_flags_struct_set_p (prev);
587
  prev_fast_math = fast_math_flags_struct_set_p (prev);
585
  cur_fast_math  = fast_math_flags_struct_set_p (cur);
588
  cur_fast_math  = fast_math_flags_struct_set_p (cur);
Lines 1336-1342 c_cpp_builtins (cpp_reader *pfile) Link Here
1336
  builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
1339
  builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
1337
1340
1338
  /* Fortify Source enabled by default w/optimization.  */
1341
  /* Fortify Source enabled by default w/optimization.  */
1339
  cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
1342
  if (cpp_defined (pfile,
1343
		   (const unsigned char *) "__OPTIMIZE__",
1344
		   (int) strlen("__OPTIMIZE__")))
1345
    cpp_define (pfile, "_FORTIFY_SOURCE=(__OPTIMIZE__ > 0 ? 2 : 0)");
1340
1346
1341
  /* Misc.  */
1347
  /* Misc.  */
1342
  if (flag_gnu89_inline)
1348
  if (flag_gnu89_inline)

Return to bug 621036