- To: Ian Lance Taylor <iant@xxxxxxxxxx>
- Subject: Re: Preventing scheduling of normal operations across calls to built-ins
- From: Ayonam Ray <ayonam@xxxxxxxxx>
- Date: Thu, 23 Feb 2012 01:23:52 +0530
- Authentication-results: mr.google.com; spf=pass (google.com: domain of ayonam@xxxxxxxxx designates 10.60.8.197 as permitted sender) smtp.mail=ayonam@xxxxxxxxx; dkim=pass header.i=ayonam@xxxxxxxxx
- Cc: gcc-help@xxxxxxxxxxx
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1330545268; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:MIME-Version:Received:Received:In-Reply-To: References:Date:Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=6kBrU4P1JWlIgTZiARqARPs9YPA=; b=rMqjb4/mniTZwpn KkibdGHHQZAEEtriHm1WQ3rdhkZ6csIpAGBO8TaE1itNfBpVcbo7RZJQTGaT7A7b GGUPMr8mxPUNDx4zOkYULK7i2GhuZD0lMKzSrTFTFnvU5nKW15sKuRaUmc59A/rJ VwKcD57pCvGcP9pWewv6QX5GiIas=
- In-reply-to: <mcraa4alod2.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
On 22 February 2012 23:52, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
> Ayonam Ray <ayonam@xxxxxxxxx> writes:
>
>> I'm wondering whether the compiler upon seeing an enum and an
>> immediate value as the arguments to the builtin is assuming that the
>> builtin does not have or create any dependence on the rest of the
>> code.
>
> That by itself should not do it unless you mark the builtin function as
> pure or const, which you did not do.
>
> I suspect that what is happening is something related but slightly
> different. The problem is not the arguments you are passing to the
> builtin function, it's the fact that your other code does not depend on
> memory, and gcc knows that a function call can only affect memory,
> nothing else. So gcc thinks that your other operations are independent
> of your builtin function.
>
> I think you are going to have to expand your builtin function into an
> asm very early on, and that asm is going to have to clobber all
> registers. There may be some other way to implement this, but offhand I
> don't know of one.
>
> Ian
Ian,
I will give it a try. Is there a way to mark all registers as
clobbered in an RTL (like we can do for memory using (clobber (mem:BLK
(const_int 0))) )?
Regards
Ayonam
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]