This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Might a -native-semantics switch, forcing native target optimization semantics, be reasonable?


Gabriel Dos Reis wrote:

Robert Dewar <dewar@adacore.com> writes:

| Gabriel Dos Reis wrote:
| | >Robert Dewar <dewar@adacore.com> writes:
| >
| >| Gabriel Dos Reis wrote:
| > | | >Maybe that is the case for Ada; for the C or C++ standards,
| > you'll
| >| > have to define "good reason". -- Gaby
| >| >
| >| Again, I suggest that vague high level discussion is a waste of time
| > | here, I wholeheartly agree, that is why I find you need to back up
| > your
| >universal claim.
| >
| You mean my claim that the standards group knows what it is doing and
| is not stupid? :-)


Your claim was this:

 # IN every case where the standard specifies undefined behavior, it
 # has a very good reason for doing so.

| Well I could give many examples,

unless "many" == "exhaustive", you'll just have wasted time and
bandwidth :-)


Right, which is why I decline :-)

| but I still think it is more useful to get back to the original intent
| of Paul's thread,


but that is exactly the point! We can't usefully discuss his
intent with unsupported claims.


I agree, we can only discuss his intent if he gives specific examples

I predict we will end up changing nothing for GCC; I also predict that
he'll be unsatisfied with unsupported claims; then, there is a high
chance the discussion will be restarted again in a different form
(hey, this is not the first time you, Paul and me are involved in this
kind of undefined discussion).  If we have good answers with backed up
claims, we could just reference it later.

I agree with your prediction



| which is to describe specific semantics for some of
| these cases. Otherwise we
| are really discussing entirely irrelevant matters.

I think supported answers will help diminish undefined disucssion frequency.
If you don't have a definition for "good reason", that is fine. Let's move
on something else; this is a new year.


My definition of good reason does not differ from the dictionary definition, nothing special. My
point is that at least for the cases I am aware of, the decision to make something undefined in
the standard makes sense, and it is not "ab initio" obvious what it would mean to say that
the semantics should be those of the native target. That does not mean it is inappropriate
to define them further in specific cases.


As you know, my general view is that GCC is a little too ready to take advantage of
undefined in its optimization approach, so I am not unsympathetic to discussing specific
cases in which this should at least optionally be constrained. We have already discussed
the wrap situation in detail, though Paul's mention of saturating arithmetic seems way
out of left field to me, since very few common architectures implement saturating
arithmetic at the hardward level.


-- Gaby






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]