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 6171741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:16:11+00:00 2026-05-23T23:16:11+00:00

I am trying to use the GCC pragma optimize to set global optimizations in

  • 0

I am trying to use the GCC pragma optimize to set global optimizations in my C code. GCC version is 4.4.3 on Ubuntu. The basic idea is to use function specific optimization levels.

#pragma GCC optimize ("O3")

I get a compilation error
just before my main function in my C code

But when I build it, I get compilation error as below –

passrecovery.c: In function âmainâ:
passrecovery.c:493: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make: *** [all] Error 1

I checked the README.Bugs file, mentioned in the error, but found no clues regarding this.

Is #pragma optimize supported in 4.4.3 GCC or not?

If yes, then what is that I am doing incorrectly in using this pragma to optimize the code.

Any other alternative GCC directive for optimizing the code for speed?

EDIT: I even tried #pragma GCC push_options then #pragma GCC optimize ("O3") and at end of file #pragma GCC pop_options; same error.

  • 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-05-23T23:16:12+00:00Added an answer on May 23, 2026 at 11:16 pm

    An ICE (internal compiler error) leading to a segmentation fault is always a bug in the compiler, which is why it asks you to report the bug. You should not be able to crash the compiler with any source code, valid or invalid. (There are all sorts of things that may happen, most often involving a refusal to compile invalid code, but crash isn’t one of them.)

    Since GCC 4.6.1 is current, why not consider an upgrade to a more recent version of GCC (not that 4.4.3 is all that old).

    Before submitting a bug report, you should try to minimize your reproduction. Everything from line 494 onwards is probably immaterial; with luck, you can reduce the material between lines 1 and 493 from almost 500 down to 20 or so. You should certainly aim to reduce it as much as possible while preserving the error. Before you start chopping the code, preserve the version that crashes the compiler. As you successfully remove the code while preserving the crash, check each successive version into your VCS. (You are using a VCS, aren’t you? That’s a rhetorical question; if you’re not, now’s a good time to start. You need one to avoid making changes that can’t be undone.) Try to eliminate non-standard headers (ones you’ve written) before eliminating standard headers. Try to get rid of as many headers as possible. Note the request for preprocessed source – the code reduction I’m talking of reduces the size of the preprocessed source.

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

Sidebar

Related Questions

I'm trying to build GCC for use with an AVR microcontroller and avr-ada, and
I was trying use a set of filter functions to run the appropriate routine,
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
I'm trying to use NetBeans to compile C code and have the following versions
Trying to use the RHEL5.3 GCC 4.3.2 compiler to build my software on that
I am using eclipse and cygwin gcc compiler. Trying to use the Python.h for
I am trying to use std::shared_ptr in my code. I have seen there have
I'm trying to use the boost library in my code but get the following
I get an error when trying to use VPython on Ubuntu 11.10. I installed
I'm trying to use GCC (linux) with a makefile to compile my project. I

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.