This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Control flow implementation in assembler
- To: cchavva at cygnus dot com
- Subject: Re: Control flow implementation in assembler
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 15 Mar 2000 17:09:29 -0800
- CC: gcc-local at cygnus dot com, binutils at sourceware dot cygnus dot com, sce-project at cygnus dot com
- References: <Pine.SOL.3.91.1000315162716.836n-100000@emperor.cygnus.com>
Date: Wed, 15 Mar 2000 16:43:24 -0800 (PST)
From: Chandra Chavva <cchavva@cygnus.com>
I am working on SCEI project. As per the contract, i need to implement
warning message for some sequence of instructions taking account of
control flow.
Cygnus contracts are only of mild interest to the readers of
binutils@sourceware.cygnus.com, a list most of whose members do not
work at Cygnus.
In this example, even when addq insn is 8 insns apart from div insn,
still assembler needs to give warning message because at run time the
branch insn will make addq 1 insn apart to div insn.
If the processor has call instructions, I don't see how you can do
this correctly. If a div is followed by a call, then you are in
trouble if any instruction at the start of the function being called
uses the Q register. But the assembler can't know that.
To do this correctly within a single file, you need to build a control
flow graph. Nothing in the assembler does that right now. Still,
it's not that hard. Just record labels, branches, instruction counts,
and uses of the Q register.
Ian