This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Multiple jumps in one instruction
- To: Toshi Morita <tm2 at best dot com>
- Subject: Re: Multiple jumps in one instruction
- From: Jonathan Buzzard <jonathan at buzzard dot org dot uk>
- Date: Fri, 25 May 2001 20:35:20 +0100
- cc: gcc at gcc dot gnu dot org
- References: <200105251739.KAA22181@shell14.ba.best.com>
tm2@best.com said:
[SNIP]
> This scheme has huge problems.
> Consider this:
>
> static int a = 5;
> void func1(void)
> {
> return a *= 5;
> }
> void func2(void)
> {
> return a *= 3;
> }
> void main(void)
> {
> printf("%d\n", func1() + func2());
> }
>
> This program semi-randomly print either 90 or 100 depending on the
> timing between threads.
The same sort of problem that any multi-threaded program has. I know all
about the potential problems and ISO volations. The question still remains
can I do it. All I can say is for the processor in question it makes sense
to do this. The semi-random nature as you put it presumes the existence of
only one execution unit by the way.
JAB.
--
Jonathan A. Buzzard Email: jonathan@buzzard.org.uk
Northumberland, United Kingdom. Tel: +44(0)1661-832195
--
Jonathan A. Buzzard Email: jonathan@buzzard.org.uk
Northumberland, United Kingdom. Tel: +44(0)1661-832195