Operating System - Linux
1752808 Members
6171 Online
108789 Solutions
New Discussion

Re: cc/aCC feature request (computed gotos)

 
Duraid Madina
Occasional Contributor

cc/aCC feature request (computed gotos)

Hi everyone,

First, I should apologize for not knowing the correct place to lodge cc/aCC feature requests. If someone could fill me in on the right way of doing this, I'd really appreciate it.

Having said that, I'd like to ask that HP support support computed gotos ("labels as values") in cc and aCC, a language extension which some other C/C++ compilers (notably GCC) support. (See the page:
http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html for more details about this)

This extension is great for people writing interpreter code where performance is important. It also has other uses, such as (sometimes) eliminating massive switch statements that can make code very verbose and a little difficult to read.

The reason I'm reluctant to use GCC is because I'm on Itanium, where GCC gives very poor performing code. I want to congratulate the HP compiler guys on the great job they're doing with their Itanium back-end. It would be truly amazing if the compiler can still emit multiway branches in the presence of computed gotos, not just switch statements!

Well, I hope that this extension will make it into HP's great compilers one day soon!
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: cc/aCC feature request (computed gotos)

If you want an enhancement, you need a support contract and you contact the Response Center.

I believe this is now there for the PA HPC compiler.

If you want performance, using switches is faster than assigned goto, at least on PA. And all of those labels/gotos would cause the optimizer to take a long time.

Assigned gotos may be in the next IPF release, possibly in June 2006. You will need to use -Agcc or -Ag++.