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]

Re: type based aliasing again


Sorry, I responded to Mark's message too quickly and didn't grasp
a key point.

> However, I do think this might be a good way to get useful warnings.
> So, I would amend your proposal to "issue a warning and then tell the
> compiler that there is no aliasing."

Sigh.  If we can tell the user's intent, we should try to do the right thing.
If we're going to deliberately do the wrong thing, it would be best
to just issue a hard error.  The compiler shouldn't go on to do something
that we know has a good chance of generating bogus code.

So we have three variants.

A).  If we detect a rule violation, issue a warning and tell the compiler
     to assume aliasing.

B).  If we detect a rule violation, issue a warning and tell the compiler
     to assume no aliasing. (That is, produce bad code).

C).  If we detect a rule violation, issue an error and don't go on.

I think that only A) and C) are reasonable.  B) is not.  I would prefer
A).







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