JPH05224944A - Alignment matching method - Google Patents

Alignment matching method

Info

Publication number
JPH05224944A
JPH05224944A JP5904992A JP5904992A JPH05224944A JP H05224944 A JPH05224944 A JP H05224944A JP 5904992 A JP5904992 A JP 5904992A JP 5904992 A JP5904992 A JP 5904992A JP H05224944 A JPH05224944 A JP H05224944A
Authority
JP
Japan
Prior art keywords
alignment
exception
data
source code
pointer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5904992A
Other languages
Japanese (ja)
Inventor
Hajime Nishikaze
一 西風
Kazutoshi Nakano
和俊 中野
Kazunori Nishikawa
一紀 西川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP5904992A priority Critical patent/JPH05224944A/en
Publication of JPH05224944A publication Critical patent/JPH05224944A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To diagnose a fact that an alignment exception is generated, and to automatically avoid it by setting an exception avoiding code to a generated part by detecting a part in which a model conversion is performed by a data reference executed by a pointer. CONSTITUTION:When an alignment control part 1 recognizes a source code, a model conversion detecting means 2 executes a collection of model converting information for specifying a model conversion performing part of a pointer on the source code (S1). Thereafter, an alignment determining means 3 recognizes collected model converting information (S2), and determines a pair of alignments (S3). An alignment relation deciding means 4 decides whether an alignment exception is generated or not from a relation of the alignment determined by the alignment determining means 3 (S4). In the case where the alignment exception is generated, it is outputted by using a display and a printer, etc.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ソースコードをオブジ
ェクトコードにコンパイルする際に、ソースコード上に
記述された型変換によるアラインメント例外の発生を回
避することのできるアラインメント整合方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an alignment matching method capable of avoiding the occurrence of an alignment exception due to type conversion described in source code when compiling the source code into object code.

【0002】[0002]

【従来の技術】計算機の中には、処理の高速性を実現す
るため、データの型(データ長)に応じて、特定の境界
(領域)にデータを配置しなければならない制約を設け
ているものがある。このような制約は、アラインメント
の制約と呼ばれている。
2. Description of the Related Art In a computer, in order to realize high-speed processing, there is a constraint that data must be arranged at a specific boundary (area) according to the data type (data length). There is something. Such a constraint is called an alignment constraint.

【0003】例えば、一語長(32ビット)の整数型デ
ータは語境界(32ビットデータ領域)に、半語長(1
6ビット)の整数型データは半語境界(16ビットデー
タ領域)にデータを配置することになる。データの配置
は、コンパイラがソースコードを翻訳する際に、ソース
コード中で参照されるデータの型に応じて、境界を判断
し、アラインメントの制約に反しない境界にデータを配
置する。
For example, integer type data of one word length (32 bits) has a half word length (1
Data of 6-bit integer type data is arranged on a half-word boundary (16-bit data area). As for the data arrangement, when the compiler translates the source code, the boundary is determined according to the type of data referred to in the source code, and the data is arranged at the boundary that does not violate the alignment constraint.

【0004】さて、例えばC言語のようなポインタ型を
持ち、ポインタ間での型変換が許容されるプログラミン
グ用高位言語で記述されたソースコードにおいては、ポ
インタにより参照されるデータが、参照しようとすると
するデータ(変数)の型に応じた境界上に配置されると
は限らない。即ち、半語境界上のデータ用に宣言された
変数が、ポインタにより半語境界上のデータを参照する
以外に、語境界上のデータを参照するような場合が想定
される。もし、境界の異なるデータを参照した場合、ア
ラインメント例外が発生することになる。
Now, in a source code written in a high-level programming language that has a pointer type such as C language and allows type conversion between pointers, the data referred to by the pointer tries to reference. Then, it is not always arranged on the boundary according to the type of data (variable). That is, it is assumed that a variable declared for data on a half word boundary refers to data on a word boundary in addition to referring to data on a half word boundary by a pointer. If you refer to data with different boundaries, an alignment exception will occur.

【0005】図2に、アラインメント例外に係る第1の
説明図を示す。図に示したソースコードにおいて、変数
i,*ipは語境界に、配列Cはバイト境界に配置され
ることになる。しかし、行L1において、整数型のポイ
ンタipに、キャラクタ型の配列Cのアドレスが代入さ
れたため、ポインタipにより参照される整数型のデー
タは、語境界ではなくバイト境界に配置されていること
になる。その後、行L2においてポインタipにより代
入される整数型のデータが語境界にあるものとして取扱
った場合、アラインメント例外となる。即ち、行L2を
実行すると、アラインメント例外が発生することにな
る。
FIG. 2 shows a first explanatory diagram related to the alignment exception. In the source code shown in the figure, the variables i and * ip are arranged on word boundaries, and the array C is arranged on byte boundaries. However, in line L1, since the address of the character array C is assigned to the integer pointer ip, the integer data referred to by the pointer ip is arranged at the byte boundary instead of the word boundary. Become. After that, if the integer type data assigned by the pointer ip in the line L2 is treated as being on a word boundary, an alignment exception occurs. That is, when the line L2 is executed, an alignment exception will occur.

【0006】一般的に、このようなアラインメント例外
の発生を回避するため、ソースコード上にアラインメン
トの整合を取るためのコーディングを実施することにな
る。図3に、アラインメント例外に係る第2の説明図を
示す。図に示すように、作業用の変数wを用意し、行L
3において変数wに変数*ipに代入すべき値を代入す
る。その後、行L4において、変数wの示すアドレス上
から一語長のデータをポインタipの指すアドレスに複
写する。
In general, in order to avoid the occurrence of such an alignment exception, the coding for aligning the alignment is performed on the source code. FIG. 3 shows a second explanatory diagram related to the alignment exception. As shown in the figure, prepare a work variable w and
In 3, the value to be assigned to the variable * ip is assigned to the variable w. After that, in line L4, the data of one word length is copied from the address indicated by the variable w to the address indicated by the pointer ip.

【0007】ここで、図4及び図5を参照して、図3に
おいて説明した複写に係る具体的な説明を行なう 図4は、データ参照時のアラインメント例外に係る説明
図である。例えばポインタpによりデータを参照するソ
ースコードに対応するオブジェクトコードは、1命令で
済む。しかし、アラインメント例外を回避するため、作
業用変数を介して値を参照する場合、バイト単位で作業
用変数へデータの複写を実施し、さらに作業用変数の参
照といった一連の処理のため、オブジェクトコード上で
は9命令必要となる。
Now, a specific description of the copying described with reference to FIG. 3 will be given with reference to FIGS. 4 and 5. FIG. 4 is an explanatory diagram related to an alignment exception when referring to data. For example, the object code corresponding to the source code that refers to the data by the pointer p requires only one instruction. However, in order to avoid an alignment exception, when referencing a value via a work variable, data is copied to the work variable in byte units, and a series of processes such as reference to the work variable are performed. The above requires 9 instructions.

【0008】図5は、データ格納時のアラインメント例
外に係る説明図である。図4同様に、ポインタpにより
データを格納するソースコードに対応するオブジェクト
コードは1命令で済む。しかし、アラインメント例外を
回避するため格納する値を作業用変数に代入し、その後
作業用変数からポインタpの指すアドレスへ、バイト単
位でデータの複写を実施するといった一連の処理のた
め、オブジェクトコード上では9命令が必要となる。
FIG. 5 is an explanatory diagram related to an alignment exception at the time of storing data. Similar to FIG. 4, the object code corresponding to the source code for storing the data by the pointer p needs only one instruction. However, in order to avoid the alignment exception, the value to be stored is assigned to the work variable, and then the data is copied in bytes from the work variable to the address pointed to by pointer p. Then 9 instructions are required.

【0009】[0009]

【発明が解決しようとする課題】さて、アラインメント
例外となるデータ参照箇所を発見するためには、ソース
コードを目視によりトレースする方法や、実際に実行さ
せて異常終了する箇所を検出する等の方法が取られる。
トレースや実際に実行させる等の方法の場合、多大な時
間を費やすことになり、さらには発見漏れを完全に回避
するのが非常に難しいといった問題が生じていた。ま
た、コンパイラがソースコード上の全てのポインタ参照
についてアラインメント例外を回避するための回避コー
ドを設定する場合、命令数の増加により実行効率が著し
く落ちてしまうといった問題が生じていた。本発明は以
上の点に着目してなされたもので、トレースや実行を伴
なうことなくアラインメント例外が発生する箇所を検出
することができ、さらにアラインメント例外を回避する
ための回避コードの設定を必要最小限にすることのでき
るアラインメント整合方法を提供することを目的とす
る。
Now, in order to find a data reference point that is an alignment exception, a method of visually tracing the source code, a method of detecting a point of abnormal execution by actually executing it, or the like is used. Is taken.
In the case of a method such as tracing or actually executing it, a great amount of time is spent, and there is a problem that it is extremely difficult to completely avoid omission of discovery. Further, when the compiler sets the avoidance code for avoiding the alignment exception for all pointer references on the source code, there is a problem that the execution efficiency is significantly reduced due to the increase in the number of instructions. The present invention has been made paying attention to the above points, and it is possible to detect a location where an alignment exception occurs without tracing or execution, and to set the avoidance code to avoid the alignment exception. It is an object of the present invention to provide an alignment matching method that can be minimized.

【0010】[0010]

【課題を解決するための手段】本発明のアラインメント
整合方法は、ソースコードをオブジェクトコードにコン
パイルする場合に、所定のアラインメントが設定された
基本データと、別のアラインメントが設定された変形デ
ータとの間の型変換を実施するための命令がある場合
に、前記データ毎の位置を指す一対のポインタを検出
し、前記基本データを指す一方のポインタによって、当
該基本データの前記アラインメントと、前記変形データ
を指す他方ポインタによって、当該変形データの前記ア
ラインメントとを認識し、両者のアラインメントが相違
した場合、前記型変換による前記アラインメント例外が
発生することを診断することを特徴とする。また、コン
パイラがソースコードに含まれ、アラインメント例外の
発生箇所を特定する為のコンパイラ指令を認識し、前記
発生箇所に例外回避コードを設定して、前記アラインメ
ント例外の発生を自動的に回避する。
According to the alignment matching method of the present invention, when compiling a source code into an object code, basic data having a predetermined alignment and modified data having another alignment are set. When there is an instruction for performing a type conversion between the two, the pair of pointers that point to the position of each of the data is detected, and one of the pointers that points to the basic data causes the alignment of the basic data and the modified data. The other pointer that points to recognizing the alignment of the modified data and diagnosing that the alignment exception occurs due to the type conversion when the alignments of the two are different. Further, the compiler recognizes a compiler directive included in the source code for specifying the location where the alignment exception occurs, sets an exception avoidance code at the location where the alignment exception occurs, and automatically avoids the occurrence of the alignment exception.

【0011】[0011]

【作用】この方法は、ポインタによるデータ参照による
型変換が実施される箇所を検出し、アラインメントが相
違する型変換の場合、型変換によるアラインメント例外
が発生することを診断する。また、ソースコード上のア
ラインメント例外の発生箇所を特定する為のコンパイラ
指令を認識し、コンパイラ指令により特定される発生箇
所に例外回避コードを設定し、アラインメント例外の発
生を自動的に回避する。
According to this method, the location where the type conversion is performed by referring to the data by the pointer is detected, and in the case of the type conversion in which the alignment is different, it is diagnosed that an alignment exception due to the type conversion occurs. Also, the compiler directive for identifying the location of the alignment exception on the source code is recognized, and the exception avoidance code is set at the location identified by the compiler directive to automatically avoid the occurrence of the alignment exception.

【0012】[0012]

【実施例】図1に、本発明に係るコンパイラの概念図を
示す。本発明を実現するため、コンパイラにはアライン
メント制御部1が設けられている。アラインメント制御
部1には、型変換検出手段2、アラインメント決定手段
3、アラインメント関係判定手段4が設けられている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows a conceptual diagram of a compiler according to the present invention. In order to implement the present invention, the compiler is provided with the alignment control unit 1. The alignment control unit 1 is provided with a type conversion detecting unit 2, an alignment determining unit 3, and an alignment relationship determining unit 4.

【0013】型変換検出部2は、ソースコードからポイ
ンタの型変換情報を検索し、その位置記憶を行なうもの
である。アラインメント決定手段3は、型変換検出部2
により記憶された型変換情報のアラインメントを決定す
るものである。アラインメント関係判定手段4は、アラ
インメント決定手段3において決定された一対のアライ
ンメントがアラインメント例外を生じるか否かを判定す
るものである。
The type conversion detector 2 retrieves pointer type conversion information from the source code and stores the position. The alignment determining means 3 includes the type conversion detecting section 2
To determine the alignment of the type conversion information stored by. The alignment relationship determination means 4 determines whether or not the pair of alignments determined by the alignment determination means 3 causes an alignment exception.

【0014】さて、アラインメント制御部1がソースコ
ードを認識すると、型変換検出手段2がソースコード上
のポインタの型変換実施箇所を特定する型変換情報の収
集を行なう(ステップS1)。その後、アラインメント
決定手段3は、収集された型変換情報を認識し(ステッ
プS2)、一対のアラインメントを決定する(ステップ
S3)。
When the alignment control section 1 recognizes the source code, the type conversion detecting means 2 collects the type conversion information for specifying the type conversion execution point of the pointer on the source code (step S1). Then, the alignment determination means 3 recognizes the collected type conversion information (step S2), and determines a pair of alignment (step S3).

【0015】アラインメント関係判定手段4は、アライ
ンメント決定手段3の決定したアラインメントの関係か
ら、アラインメント例外が発生するか否かを判定する。
アラインメントの制約は、語境界、半語境界、バイト境
界の順序で、順次規制が緩くなる傾向がある。従ってこ
の規制関係により、より規制の強いものに対するデータ
参照の場合は、アラインメント例外が発生するものとし
て判断し、ステップS5に処理が移る。
The alignment relationship determining means 4 determines whether or not an alignment exception occurs based on the alignment relationship determined by the alignment determining means 3.
Alignment restrictions tend to become looser in the order of word boundaries, half-word boundaries, and byte boundaries. Therefore, due to this regulatory relationship, in the case of data reference to a more restrictive one, it is determined that an alignment exception will occur, and the process proceeds to step S5.

【0016】ステップS5では、判定対象とした型変換
実施箇所がソースコード上のアラインメント例外の発生
箇所である報告を、図示しないディスプレイやプリンタ
等を用いて出力する。その後、アラインメント制御部1
は、型変換検出手段2が検出した型変換情報が他に存在
するか否かを判断し(ステップS6)、結果がYESの
場合、ステップS2へ移り、結果がNOの場合、処理を
終了する。なお、ステップS4の結果、アラインメント
例外が発生しないものと判断した場合はステップS6に
処理が移る。
In step S5, a report in which the type conversion execution point to be determined is the location of the alignment exception on the source code is output using a display, a printer or the like (not shown). After that, the alignment control unit 1
Determines whether or not there is any other type conversion information detected by the type conversion detection means 2 (step S6). If the result is YES, the process proceeds to step S2, and if the result is NO, the process is terminated. .. If it is determined in step S4 that the alignment exception does not occur, the process proceeds to step S6.

【0017】次に、図6以降の図面を参照しながら、本
発明の詳細な説明を行なう。図6は、ソースコードの概
念図である。図に示したソースコードにおいて、行L5
〜L9の実行に伴いポインタの型変換が生じる。これら
の行は、型変換検出手段2に収集され、アラインメント
決定手段においてアラインメントが決定される。
The present invention will now be described in detail with reference to the drawings starting from FIG. FIG. 6 is a conceptual diagram of the source code. In the source code shown in the figure, line L5
The type conversion of the pointer occurs along with the execution of L9. These lines are collected by the type conversion detecting means 2 and the alignment is determined by the alignment determining means.

【0018】行L5は、半語境界のポインタq1を、語
境界として参照するポインタp1に代入する処理であ
る。行L6は、語境界のポインタp1を、半語境界とし
て参照するポインタq1に代入する処理である。行L7
は、半語境界のポインタq2を、語境界のポインタP2
に代入する処理である。
Line L5 is a process for substituting the pointer q1 at the half word boundary into the pointer p1 which is referred to as the word boundary. Line L6 is a process of substituting the pointer p1 of the word boundary for the pointer q1 which is referred to as the half word boundary. Row L7
Is a half-word boundary pointer q2 and a word boundary pointer P2
Is the process of substituting into.

【0019】行L8は、半語境界のメンバが含まれる構
造体を、語境界のメンバが含まれる構造体に代入する処
理である。行L9は、語境界のメンバが含まれる構造体
を、半語境界のメンバが含まれる構造体に代入する処理
である。
Line L8 is a process for substituting a structure containing a member of a half word boundary into a structure containing a member of a word boundary. Line L9 is a process of substituting a structure including a member of a word boundary into a structure including a member of a half word boundary.

【0020】以上の構成の各行に対するアラインメント
関係判定手段4の動作を、図7を参照して説明する。図
7は、本発明に係る処理説明図である。型変換検出手段
2により、型変換情報71が収集されると、アラインメ
ント決定手段3は、それぞれのポインタの宣言部分を基
に、アラインメント72の決定を行なう。
The operation of the alignment relation determining means 4 for each row having the above configuration will be described with reference to FIG. FIG. 7 is a process explanatory diagram according to the present invention. When the type conversion detecting unit 2 collects the type conversion information 71, the alignment determining unit 3 determines the alignment 72 based on the declaration part of each pointer.

【0021】アラインメント関係判定手段4は、アライ
ンメント決定手段3により決定されたアラインメントの
相関関係、即ち規制の度合いを解析し、アラインメント
例外発生の有無73を判定し、判定結果の報告を実施す
ることになる。なお、アラインメント決定手段3は、構
造体のアラインメントを決定する際、最も規制の強いメ
ンバのアラインメントを構造体のアラインメントとして
採用する。以上のような手順により、ポインタの型変換
箇所についてアラインメント例外の発生の有無を解析す
る。
The alignment relation judging means 4 analyzes the correlation of the alignment determined by the alignment determining means 3, that is, the degree of regulation, judges the presence / absence 73 of the alignment exception, and reports the judgment result. Become. When determining the alignment of the structure, the alignment determining means 3 adopts the alignment of the member having the strongest regulation as the alignment of the structure. With the above procedure, the presence or absence of an alignment exception is analyzed at the pointer type conversion location.

【0022】次に、本発明の第2の実施例について説明
する。図8は、本発明の第2の実施例に係る第1のソー
スコード例である。第2の実施例を実現する為、ソース
コードには、予めコンパイラに対してアラインメント例
外の発生する箇所を通知するコンパイラ指令を含ませ
る。コンパイラ指令は、“#pragma”で始まるもので
(行L10)、この場合、ポインタpについて、対応す
る指示を示している。
Next, a second embodiment of the present invention will be described. FIG. 8 is a first source code example according to the second embodiment of the present invention. In order to realize the second embodiment, the source code includes in advance a compiler directive for notifying the compiler of the location where the alignment exception occurs. The compiler directive starts with "#pragma" (line L10), and in this case, indicates the corresponding instruction for the pointer p.

【0023】この場合、行L11においてポインタpに
関する型変換が実施されるため、コンパイラ指令がこの
行L11を対象に起動する。具体的には、先に図5にお
いて説明した、バイト単位でデータの取出しを行なうオ
ブジェクトコード(アラインメント例外を回避するため
の例外回避コード)が行L11に対して生成される。
In this case, since the type conversion relating to the pointer p is performed in the line L11, the compiler directive is activated for this line L11. Specifically, the object code (exception avoidance code for avoiding an alignment exception) for fetching data in units of bytes described above with reference to FIG. 5 is generated for the line L11.

【0024】コンパイラ指令は、局所的な識別子のみで
なく、広域的に、例えば構造体等に対しても指定するこ
とが可能である。図9に、本発明の第2の実施例に係る
第2のソースコード例を示す。図において。行L13
は、型定義(行L14)を対象とするコンパイラ指令で
あり、行15は、タグ名(行L16の構造体)を対象と
するコンパイラ指令である。また、行L17は、半語長
のアラインメントを採用しているアーキテクチャについ
ての記述例である。
The compiler directive can be specified not only for a local identifier but also for a wide area, for example, for a structure. FIG. 9 shows a second source code example according to the second embodiment of the present invention. In the figure. Line L13
Is a compiler directive for the type definition (line L14), and line 15 is a compiler directive for the tag name (structure of line L16). Also, line L17 is an example description of an architecture that employs half-word length alignment.

【0025】図10に 本発明の第2の実施例に係るコ
ンパイラの概念図を示す。構文意味解析部11がソース
コードSCを解析し、コンパイラ指令の認識を行なう。
構文意味解析部11は、コンパイラ指令を認識すると、
アクセス種別を認識する。このアクセス種別は、例えば
図8に示したポインタpに対するbyte access の場合、
アクセス種別12a、記号12b、位置12cから構成
される記号表12を生成する。
FIG. 10 shows a conceptual diagram of a compiler according to the second embodiment of the present invention. The syntactic and semantic analysis unit 11 analyzes the source code SC and recognizes the compiler directive.
When the syntactic and semantic analysis unit 11 recognizes the compiler directive,
Recognize the access type. This access type is, for example, in the case of byte access to the pointer p shown in FIG.
The symbol table 12 including the access type 12a, the symbol 12b, and the position 12c is generated.

【0026】構文意味解析部11による処理が完了する
と、中間語生成部13が起動し、記号表12により指示
された箇所について例外回避コードを設定した中間語1
4を生成する。この例外回避コードには、どのような目
的で設定されたのかを示す命令14aと対象を特定する
記号14bの情報が付加される。そして最後にコード生
成部15において、中間語14がオブジェクトコードO
Cに変換される。
When the processing by the syntactic and semantic analysis unit 11 is completed, the intermediate word generation unit 13 is activated, and the intermediate word 1 in which the exception avoidance code is set for the portion designated by the symbol table 12.
4 is generated. The exception avoidance code is added with the information of the instruction 14a indicating the purpose of setting and the symbol 14b for specifying the target. Finally, in the code generator 15, the intermediate language 14 is the object code O.
Converted to C.

【0027】オブジェクトコードOCを実施することに
より、ソースコード上でコンパイラ指定が実施された箇
所について、バイト単位の取出し(格納)が実施される
ことになる。以上の説明の第2の実施例により、所望の
箇所に自動的に例外回避コードを設定することができ
る。
By executing the object code OC, the byte unit is taken out (stored) at the location where the compiler is specified in the source code. According to the second embodiment described above, the exception avoidance code can be automatically set at a desired location.

【0028】[0028]

【発明の効果】本発明のアラインメント整合方法による
と、ソースコードのトレースや実行を伴なうこと無くア
ラインメント例外が発生する箇所のみを的確に把握する
ことができ、作業工数の削減を実現することができ、さ
らに例外回避コードを設定する箇所を必要最小限に留め
ることができるため、命令数増加による動作効率の低下
を回避することができる。
According to the alignment matching method of the present invention, it is possible to accurately grasp only the place where the alignment exception occurs without tracing or executing the source code, and to reduce the work man-hour. Since the number of places where the exception avoidance code is set can be kept to a necessary minimum, it is possible to avoid a decrease in operation efficiency due to an increase in the number of instructions.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明に係るコンパイラの概念図である。FIG. 1 is a conceptual diagram of a compiler according to the present invention.

【図2】アラインメント例外に係る第1の説明図であ
る。
FIG. 2 is a first explanatory diagram related to an alignment exception.

【図3】アラインメント例外に係る第2の説明図であ
る。
FIG. 3 is a second explanatory diagram related to an alignment exception.

【図4】データ参照時のアラインメント例外に係る説明
図である。
FIG. 4 is an explanatory diagram related to an alignment exception when referring to data.

【図5】データ格納時のアラインメント例外に係る説明
図である。
FIG. 5 is an explanatory diagram related to an alignment exception when storing data.

【図6】ソースコードの概念図である。FIG. 6 is a conceptual diagram of source code.

【図7】本発明に係る処理説明図である。FIG. 7 is an explanatory diagram of processing according to the present invention.

【図8】本発明の第2の実施例に係る第1のソースコー
ド例である。
FIG. 8 is a first source code example according to the second embodiment of the present invention.

【図9】本発明の第2の実施例に係る第2のソースコー
ド例である。
FIG. 9 is a second source code example according to the second embodiment of the present invention.

【図10】本発明の第2の実施例に係るコンパイラの概
念図である。
FIG. 10 is a conceptual diagram of a compiler according to a second embodiment of the present invention.

【符号の説明】[Explanation of symbols]

1 アラインメント制御部 2 型変換検出手段 3 アラインメント決定手段 4 アラインメント関係判定手段 DESCRIPTION OF SYMBOLS 1 Alignment control unit 2 Type conversion detection means 3 Alignment determination means 4 Alignment relationship determination means

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 ソースコードをオブジェクトコードにコ
ンパイルする場合に、 所定のアラインメントが設定された基本データと、別の
アラインメントが設定された変形データとの間の型変換
を実施するための命令がある場合に、前記データ毎の位
置を指す一対のポインタを検出し、 前記基本データを指す一方のポインタによって、当該基
本データの前記アラインメントと、前記変形データを指
す他方ポインタによって、当該変形データの前記アライ
ンメントとを認識し、両者のアラインメントが相違した
場合、 前記型変換による前記アラインメント例外が発生するこ
とを診断することを特徴とするアラインメント整合方
法。
1. When compiling source code into object code, there are instructions for performing type conversion between basic data having a predetermined alignment and transformation data having another alignment. In this case, a pair of pointers pointing to the position of each of the data is detected, the one pointer pointing to the basic data causes the alignment of the basic data, and the other pointer pointing to the modified data causes the alignment of the modified data. Is recognized, and if the alignments of the two are different, it is diagnosed that the alignment exception due to the type conversion occurs.
【請求項2】 コンパイラがソースコードに含まれ、ア
ラインメント例外の発生箇所を特定する為のコンパイラ
指令を認識し、 前記発生箇所に例外回避コードを設定して、 前記アラインメント例外の発生を自動的に回避すること
を特徴とする請求項1記載のアラインメント整合方法。
2. A compiler is included in the source code, recognizes a compiler directive for identifying a location where an alignment exception occurs, sets an exception avoidance code at the location, and automatically generates the alignment exception. The alignment matching method according to claim 1, wherein the alignment matching method is avoided.
JP5904992A 1992-02-12 1992-02-12 Alignment matching method Pending JPH05224944A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5904992A JPH05224944A (en) 1992-02-12 1992-02-12 Alignment matching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5904992A JPH05224944A (en) 1992-02-12 1992-02-12 Alignment matching method

Publications (1)

Publication Number Publication Date
JPH05224944A true JPH05224944A (en) 1993-09-03

Family

ID=13102081

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5904992A Pending JPH05224944A (en) 1992-02-12 1992-02-12 Alignment matching method

Country Status (1)

Country Link
JP (1) JPH05224944A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010050128A1 (en) * 2008-10-30 2010-05-06 パナソニック株式会社 Compiling method and compiling program
JP2010186487A (en) * 2010-04-23 2010-08-26 Panasonic Corp Compiler apparatus and system therefor
US8418157B2 (en) 2002-07-03 2013-04-09 Panasonic Corporation Compiler apparatus with flexible optimization

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8418157B2 (en) 2002-07-03 2013-04-09 Panasonic Corporation Compiler apparatus with flexible optimization
WO2010050128A1 (en) * 2008-10-30 2010-05-06 パナソニック株式会社 Compiling method and compiling program
JP2010108258A (en) * 2008-10-30 2010-05-13 Panasonic Corp Compiling method and compiling program
JP2010186487A (en) * 2010-04-23 2010-08-26 Panasonic Corp Compiler apparatus and system therefor

Similar Documents

Publication Publication Date Title
US5854932A (en) Compiler and method for avoiding unnecessary recompilation
EP0406602B1 (en) Method and apparatus for debugging parallel programs by serialization
JP3195839B2 (en) How to monitor the operation of power plant facilities
US6253373B1 (en) Tracking loop entry and exit points in a compiler
JP2000305809A (en) Memory access analyzing method, memory access tracing device, and computer-readable recording medium
US20060200796A1 (en) Program development apparatus, method for developing a program, and a computer program product for executing an application for a program development apparatus
JPH06324881A (en) Compiler device with superposition deciding function of memory data
US6330714B1 (en) Method and computer program product for implementing redundant lock avoidance
CN108664238A (en) A kind of execution method and device of explanation type script C-SUB
JPH05224944A (en) Alignment matching method
CN112313626A (en) Deadlock detection and synchronization perception optimization method on asynchronous processor architecture
EP0365186A2 (en) Apparatus for enhanced tagged data processing in a generalized computer execution unit
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
JP3114199B2 (en) List output method of language processing system
JP3130421B2 (en) Program analysis method and apparatus
JP2797777B2 (en) Language processor
JP2786689B2 (en) Compiler processing method
JP3018783B2 (en) Compilation method
JPH0981411A (en) Compiler
JP2795309B2 (en) Code addition method for profiler
JP2507676B2 (en) Index I / O statement execution processing method
Kiong et al. Introduction to Language Implementation
Roubine et al. Lolita: a low level intermediate language for Ada
JPH03260836A (en) Pointer optimization processing method
JPH0644101A (en) Program debug processing method