other than pragma

W

Walter Roberson

Teh optmizations that cn be achived by the compile line options -O4 etc

The original article has not shown up here, so I am perhaps missing
some key context, but the answer is three-fold:

1) C has a very limited number of standard pragmas (and no
standard pragmas at all in C90), none of which has to do with
optimization. Any pragma along this lines that you happened to find
would be non-portable (but ignored by other compilers that did not
happen to have a pragma with the same name)

2) pragmas -suggest- rather than -enforce- .

3) I have never encountered a C compiler with a pragma that
affected optimization.
 
E

Eric Sosman

Teh optmizations that cn be achived by the compile line options -O4 etc

If you think this is a "precise" definition, you should
consider a career change ...

Try again: Offer a *precise* definition of "optimizations,"
using terms that are applicable to all systems where C is
implemented, and that cover all (or at least most) possible
optimality metrics. I think the effort of formulating such a
definition will teach you something valuable, and I will applaud
your sincere attempt enthusiastically by clapping one hand.
 
T

Tim Prince

Walter said:
3) I have never encountered a C compiler with a pragma that
affected optimization.

This is well outside the limits of Standard C. Some of the most widely
used compilers (e.g. gcc) have no such pragmas. icc has an extremely
limited set for the latest versions. You would expect any such facilities
to be documented by the compiler in question. I don't use any compiler
which even has a -O4 option; it's fairly unusual.
 
M

Martin Ambuhl

is there any compiler directive that will enforce optimizations?

Most compilers have means to ask them to provide a range of
optimizations. However, those are to be found in the documentation for
those implementations, and have nothing to do with the C language
itself. The right place to look for this information is
1) in the documentation that came with your compiler
2) in FAQs for newsgroups or mailing lists or websites associated
with your implementation
3) in newsgroups, mailing lists, websites, or technical support for
your implementation
One place that it makes no sense to ask about these
implementation-specific details is a newsgroup about the language
itself, such as <news:comp.lang.c>.
 
W

Walter Roberson

Probably; they'll be specified in your compiler documentation.

In common English, "probably" would imply "more likely than not".
So far in this thread, only one compiler (icc) has been identified
specifically as having such pragmas. Can you identify other specific
compilers in wide use that support these kind of pragmas -- or should
your "probably" have been "possibly" ?
 
K

Kenny McCormack

In common English, "probably" would imply "more likely than not".
So far in this thread, only one compiler (icc) has been identified
specifically as having such pragmas. Can you identify other specific

Therefore, the correct answer is more than "probably". It is certainly.

The question being:
And the answer is: Yes, there is one. In icc. There may be others.
 
R

Randy Howard

In common English, "probably" would imply "more likely than not".
So far in this thread, only one compiler (icc) has been identified
specifically as having such pragmas. Can you identify other specific
compilers in wide use that support these kind of pragmas -- or should
your "probably" have been "possibly" ?

I think metrowerks CodeWarrior was also mentioned upthread. There are
a lot of variants of Codewarrior for various platforms, including a lot
of embedded ones, with various optimization pragmas. See also:

<http://docs.hp.com/en/B3901-90017/ch03s04.html>

<http://techpubs.sgi.com/library/tpl/cgi-
bin/getdoc.cgi?coll=0650&db=bks&fname=/SGI_Developer/Pragmas/ch08.html>
<http://msdn2.microsoft.com/en-us/library/aa289157(vs.71).aspx>

<http://msdn2.microsoft.com/en-us/library/ms235601.aspx>

<http://developer.apple.com/documentation/DeveloperTools/gcc-
4.0.1/gcc/Darwin-Pragmas.html>

<http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/
com.ibm.xlcpp8a.doc/compiler/ref/rnpgoptn.htm>

< http://www-306.ibm.com/software/awdtools/czos/features/czosv1r5.html>
<http://www.csc.fi/english/pages/murska_guide/program_development/optimi
zation>

<http://www.cc65.org/doc/cc65-7.html>

<http://www.pdc.kth.se/doc/pgi/4.1/pgiws_ug/pgiug_10.htm#Heading121>

<http://www.keil.com/support/man/docs/armcc/armcc_babdidhg.htm>

<http://www.htsoft.com/products/updates/show_rel_notes.php?pname=8051
C>

That should be sufficient to put paid to this line of argument. Not
all the world is gcc. In fact, not even gcc is, on some architectures.
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top