From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: mark@codesourcery.com (Mark Mitchell) Cc: jbuck@synopsys.com, gcc@gcc.gnu.org, rms@gnu.org Subject: Re: type based aliasing again Date: Wed, 08 Sep 1999 19:44:00 -0000 Message-id: <199909090242.TAA23209@atrus.synopsys.com> References: <19990908184709F.mitchell@codesourcery.com> X-SW-Source: 1999-09/msg00323.html 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). From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: mark@codesourcery.com (Mark Mitchell) Cc: jbuck@synopsys.com, gcc@gcc.gnu.org, rms@gnu.org Subject: Re: type based aliasing again Date: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: <199909090242.TAA23209@atrus.synopsys.com> References: <19990908184709F.mitchell@codesourcery.com> X-SW-Source: 1999-09n/msg00323.html Message-ID: <19990930180200.vdv_LSOZPwRftly3XZz1-j2zhjyzR9Dq2WVRYOigY00@z> 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).