Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:58:17+00:00 2026-06-12T14:58:17+00:00

GCC documentation is not particularly verbose about it. What it says is: -fexpensive-optimizations: Perform

  • 0

GCC documentation is not particularly verbose about it. What it says is:

-fexpensive-optimizations:

     Perform a number of minor optimizations that are relatively expensive.

Which kind of optimizations are these? Any example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:58:18+00:00Added an answer on June 12, 2026 at 2:58 pm

    I’m not enough of a compiler gee^H^H^H expert to be able to make much of this, but maybe someone can build on it…

    The relevant bits of gcc can be obtained easily enough (if you don’t try and check out the whole thing) with:

    svn co --depth=immediates svn://gcc.gnu.org/svn/gcc/trunk/gcc gcc
    cd gcc
    svn --set-depth infinity update config c cp
    

    (at least that’s the subset which seemed relevant to C/C++ which I found stuff in; add other directories if you’re interested in other languages gcc supports)

    And then

    grep -R flag_expensive_optimizations . | grep -v .svn
    

    yields a screen’s worth (35 lines) of hits on a small number of files. I’ll leave it to someone else to post a more detailed analysis (if anyone actually cares enough).

    A couple of them caught my eye. I’ll mention that (at time of writing):

    • The sole mention of flag_expensive_optimizations in cp/ (C++
      support) is in a section of code commented /* Handle ordinary C++
      destructors. */
      and seems to influence the setting of a
      LOOKUP_NONVIRTUAL flag, with associated comment /* Optimize for
      space over speed here. */

    • There are a few hits within the processor-specific config/ directory (sparc, alpha, sh, i386) . The only i386 one applies for TARGET_AVX when not optimizing for size and is commented /* When not optimize for size, enable vzeroupper optimization for TARGET_AVX with -fexpensive-optimizations and split 32-byte AVX unaligned load/store. */

    A glance at a few other hits persuaded me I should just be content to leave my knowledge of this feature at the level of the gcc documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the GCC documentation , __attribute__((pure)) tells the compiler that a function has
The documentation for GCC's __attribute__((...)) syntax indicates that attributes must be surrounded by double
http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Thread_002dLocal.html Documents __thread yet my g++ complains that __thread is not supported on my
I was looking at libstdc++ documentation at http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01618.html and found it arranged in modules
GCC seem to think that I am trying to make a function call in
gcc 4.4.2 c89 I have a function that has to run (config_relays). It make
I found that GCCXML is not being maintained anymore (I think the last version
I have looked through GDB documentation, but haven't found anything that works or shows
We are compiling an application that uses OpenMP. We are using gcc 4.4, with
How do I make Apple's Cocoa GUI controls not automatically flip lines that contain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.