From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266454AbTGJTkJ (ORCPT ); Thu, 10 Jul 2003 15:40:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266463AbTGJTkJ (ORCPT ); Thu, 10 Jul 2003 15:40:09 -0400 Received: from mail-out2.apple.com ([17.254.0.51]:6045 "EHLO mail-out2.apple.com") by vger.kernel.org with ESMTP id S266454AbTGJTkF (ORCPT ); Thu, 10 Jul 2003 15:40:05 -0400 Date: Thu, 10 Jul 2003 12:53:44 -0700 Subject: Re: [PATCH] Fix do_div() for all architectures Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: Dale Johannesen , Richard Henderson , Andrea Arcangeli , Linus Torvalds , linux-kernel@vger.kernel.org, Peter Chubb , Andrew Morton , Ian Molton , gcc@gcc.gnu.org To: Bernardo Innocenti From: Dale Johannesen In-Reply-To: <200307102131.45474.bernie@develer.com> Message-Id: <3645F0F8-B310-11D7-890F-000393D76DAA@apple.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, July 10, 2003, at 12:31 PM, Bernardo Innocenti wrote: > > The compiler could easily tell what memory can be clobbered by a > pointer > by applying type-based aliasing rules. For example, a function taking a > "char *" can't clobber memory objects declared as "long bar" or > "struct foo". No, for two reasons. First, anything can be aliased by a char. Second, the restriction is on the type of the eventual memory reference, not on the type of the pointer. Assuming an int* p, you can still do *((char*)p) and that may alias anything. So you must check each dereference; this can't be done easily at function entry.