-std=gnu99 optimizations

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some of my programs are smaller when compiled with -std=gnu99. (Other, more carefully optimised programs don't change at all)

Can someone point me to the page that lists optimisation changes with -std=gnu99?

-thanx-

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the gnu(89/99) extensions are documented here:

http://gcc.gnu.org/onlinedocs/gc...

Have a read through and see if any apply. But wouldn't the easy answer be to simply build both variants and compare the LSS to see how it differs?

BTW exactly which standard are you comparing gnu99 against: c89, c90, c99, c9x, c11, c1x, gnu89, gnu90, gnu9x, gnu11, gnu1x ? (gnu89 is the default).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

BTW exactly which standard are you comparing gnu99 against: c89, c90, c99, c9x, c11, c1x, gnu89, gnu90, gnu9x, gnu11, gnu1x ?

"The beauty of standards is that there are so many from which to choose." -- Andrew Tannebaum

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
"The beauty of standards is that there are so many from which to choose." -- Andrew Tannebaum
One of my favorites :)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Well the gnu(89/99) extensions are documented here:

http://gcc.gnu.org/onlinedocs/gc...

Have a read through and see if any apply. But wouldn't the easy answer be to simply build both variants and compare the LSS to see how it differs?

BTW exactly which standard are you comparing gnu99 against: c89, c90, c99, c9x, c11, c1x, gnu89, gnu90, gnu9x, gnu11, gnu1x ? (gnu89 is the default).

OK. It differs by inlining differently. No, it wasn't easy.

I'm comparing to the default (gnu89 I guess).

I've found a document that claims that inlining is different for gnu89 and gnu99 http://gcc.gnu.org/onlinedocs/gc... -- but the explanation doesn't make sense, and sort of implies the opposite to what I actually see in practice.

Reading a list of extensions hasn't helped me get any closer to a list of optimization changes with -std=gnu99. In fact, it doesn't look like there was anything relevant to the question at all.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

In fact, it doesn't look like there was anything relevant to the question at all.

Well there's a whole manual there (and several other manuals besides including the "GCC internals" one). Did none of it provide a lead?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You know, I ask questions here in case some one else knows the answers to the question.

Sometimes, no-one knows the answer, but can point to the relevant documentation.

Sometimes, no-one knows the answer, and no-one has any idea if there is any relevant documentation.