# --enable-debug and GCC 4.8 / -Og

- Thread: https://externals.io/message/68074
- Original archive: https://news-web.php.net/php.internals/68074
- Started by Sebastian Bergmann on 2013-07-07T14:31:28+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #68074 — Sebastian Bergmann — 2013-07-07T14:31:28+00:00

URL: https://externals.io/message/68074#68074

From the release notes of GCC 4.8:

   "A new general optimization level, -Og, has been introduced. It
   addresses the need for fast compilation and a superior debugging
   experience while providing a reasonable level of runtime performance.
   Overall experience for development should be better than the default
   optimization level -O0."

 Currently "--enable-debug" sets "-O0". I think it would make sense to
 use "-Og" instead when GCC >= 4.8.0 is used.

 What do you think?

---

## #68075 — Sebastian Bergmann — 2013-07-07T14:55:11+00:00

URL: https://externals.io/message/68074#68075 · In reply to: #68074

> Currently "--enable-debug" sets "-O0". I think it would make sense to
> use "-Og" instead when GCC >= 4.8.0 is used.

 https://gist.github.com/sebastianbergmann/5943708 is an attempt to
 implement this. Only tested this on Fedora 19.

---

## #68076 — Christopher Jones — 2013-07-08T16:54:41+00:00

URL: https://externals.io/message/68074#68076 · In reply to: #68075

> 
> > […]
>
>   https://gist.github.com/sebastianbergmann/5943708 is an attempt to
>   implement this. Only tested this on Fedora 19.
>

Seems reasonable.

Your test logic needs fixing.  It should be like: "if ((major > 4) || (major == 4 && minor >= 8))"

Chris

-- 
christopher.jones@oracle.com  http://twitter.com/ghrd
Free PHP & Oracle book:
http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html

---

## #68077 — Sebastian Bergmann — 2013-07-08T17:13:57+00:00

URL: https://externals.io/message/68074#68077 · In reply to: #68076

> Your test logic needs fixing.  It should be like: "if ((major > 4) ||
> (major == 4 && minor >= 8))"

 Thank you, Chris, for pointing this out. I have updated the gist.

---

## #68078 — Rainer Jung — 2013-07-08T20:34:42+00:00

URL: https://externals.io/message/68074#68078 · In reply to: #68074

>  From the release notes of GCC 4.8:
> 
>    "A new general optimization level, -Og, has been introduced. It
>    addresses the need for fast compilation and a superior debugging
>    experience while providing a reasonable level of runtime performance.
>    Overall experience for development should be better than the default
>    optimization level -O0."
> 
>  Currently "--enable-debug" sets "-O0". I think it would make sense to
>  use "-Og" instead when GCC >= 4.8.0 is used.
> 
>  What do you think?

There's a recent short discussion about -Og at

http://gcc.gnu.org/ml/gcc/2013-07/msg00001.html

Regards,

Rainer
