JP2006155386A - Compiling device and debugging device - Google Patents

Compiling device and debugging device Download PDF

Info

Publication number
JP2006155386A
JP2006155386A JP2004347302A JP2004347302A JP2006155386A JP 2006155386 A JP2006155386 A JP 2006155386A JP 2004347302 A JP2004347302 A JP 2004347302A JP 2004347302 A JP2004347302 A JP 2004347302A JP 2006155386 A JP2006155386 A JP 2006155386A
Authority
JP
Japan
Prior art keywords
instruction
machine language
instruction sequence
source program
information
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.)
Withdrawn
Application number
JP2004347302A
Other languages
Japanese (ja)
Inventor
Toshiyuki Sakata
俊幸 坂田
Hajime Ogawa
一 小川
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004347302A priority Critical patent/JP2006155386A/en
Publication of JP2006155386A publication Critical patent/JP2006155386A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a compiling device capable of determining whether optimization hint information is legitimate or not without requiring a highly-skilled programmer and without spending many man hours. <P>SOLUTION: The compiling device 102 for the optimization of machine language instruction sequences includes a code optimizing part for translating a source program 101 into an optimized machine language instruction sequence 107a according to instructions to the compiling device 102; an optimization hint information description detecting part 103 for detecting the instructions from the source program 101; an error check point detecting part 105 for detecting according to the detected instructions a position on the machine language instruction sequence where it is possible to determine whether or not the instructions are illegal; and an optimization hint description debug information creating part 106 for creating optimization hint information description debug information 107b including the description position of the instructions within the source program, the above position, and the information required to determine whether or not the instructions are illegal. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、ソースプログラムのエラーチェック機能を備えたコンパイル装置およびデバッグ装置に関し、特に、プログラマが情報の正当性を保証しなければならない最適化ヒント情報記述のエラーチェック機能を備えたコンパイル装置およびデバッグ装置に関する。   The present invention relates to a compiling device and a debugging device having an error check function of a source program, and in particular, a compiling device and an debugging device having an error checking function for description of optimization hint information for which a programmer must guarantee the validity of information. Relates to the device.

一般的に、コンパイル装置が高級言語で記述されたソースプログラムから変換したアセンブラコードは、熟練したアセンブラコードのプログラマが作成したアセンブラコードと比較した場合、実行性能とコードサイズとの面で劣る。   In general, an assembler code converted from a source program written in a high-level language by a compiling device is inferior in terms of execution performance and code size when compared with an assembler code created by a skilled assembler code programmer.

しかし、近年、コンパイル装置を用いて高級言語で記述されたソースプログラムから生成されたアセンブラコードであっても、熟練したアセンブラコードのプログラマが作成したアセンブラコードに匹敵する実行性能とコードサイズとを実現するために、アセンブラコードのプログラマがアセンブラコードの記述時に利用している情報を、最適化ヒント情報としてソースプログラム中に記述し、コンパイル装置へ受け渡す枠組みが導入されてきている。   In recent years, however, even assembler code generated from a source program written in a high-level language using a compiling device has achieved execution performance and code size comparable to assembler code created by a skilled assembler code programmer. For this purpose, a framework has been introduced in which information used by an assembler code programmer when writing assembler code is described as optimization hint information in a source program and transferred to a compiling device.

例えば、以下に示すような最適化ヒント情報が知られている。
(i) ポインタ変数を修飾し、当該ポインタ変数を介してアクセスされる領域は、その領域へのアクセスがすべてそのポインタに限定されることをプログラマがコンパイル装置に知らせるC99言語(ISO(International Organization for Standardization)/IEC(International Electrotechnical Commission) 9899:1999 Programming language C)のrestrict記述
(ii) ポインタ変数の指すメモリ領域のアラインメントをコンパイル装置に知らせるプラグマ指令
(iii) 最小繰り返し回数などのループに回数に関する情報をコンパイル装置に知らせるプラグマ指令
コンパイル装置は、これら最適化ヒント情報を用いて、コードの最適化を実施することにより、最適化ヒント情報の記述がない場合に比べ、実行性能が高く、サイズの小さなアセンブラコードを生成できる。
For example, the following optimization hint information is known.
(I) The C99 language (ISO (International Organization for ISO)) is used to modify the pointer variable and inform the compiler that the area accessed through the pointer variable is limited to the pointer. Standardization) / IEC (International Electrotechnical Commission) 9899: 1999 programming language C) restriction description (ii) Pragma command that informs compiling device of alignment of memory area pointed to by pointer variable (iii) Information on number of times to loop, such as minimum number of iterations The pragma directive that informs the compiling device The compiling device uses this optimization hint information to optimize the code, so that the execution performance is better than when no optimization hint information is written. Can generate small and small assembler code.

しかし、これら最適化ヒント情報の記述は、プログラマが最適化ヒント情報の正当性を保証しなければならず、コンパイル装置は最適化ヒント情報が正しいものとして最適化を行う。このため、最適化ヒント情報が誤っていた場合、不正なアセンブラコードを生成するという問題があり、最適化ヒント情報の記述の利用は不具合の原因となりやすい。また、コンパイル時に静的に最適化ヒント情報の正当性を判断することは非常に困難である。   However, the description of the optimization hint information requires the programmer to guarantee the validity of the optimization hint information, and the compiling device performs the optimization assuming that the optimization hint information is correct. For this reason, when the optimization hint information is incorrect, there is a problem that an incorrect assembler code is generated, and the use of the description of the optimization hint information is likely to cause a problem. In addition, it is very difficult to statically determine the validity of optimization hint information at the time of compilation.

この問題を解決するための従来の方法として、プログラマがエラーチェックのためのデッバグコードをソースプログラム中に記述し、デバッグ装置がそのデバッグコードを実行することにより、エラーチェックを行う方法が提案されている(例えば、特許文献1〜3参照。)。
特開平11−110256号公報 特開2000−76094号公報 特開2003−58392号公報
As a conventional method for solving this problem, a method has been proposed in which an error check is performed by a programmer describing debug code for error check in a source program and a debug device executing the debug code. (For example, refer patent documents 1-3.).
JP-A-11-110256 JP 2000-76094 A JP 2003-58392 A

しかしながら、従来の方法では、プログラマが最適化ヒント情報の正当性を判定するためには、最適化ヒント情報の記述箇所毎にデバッグコードを設計し、ソースプログラム中に記述しなければならない。そのための高いスキルと大きな工数が必要であるという課題を有している。   However, in the conventional method, in order for the programmer to determine the validity of the optimization hint information, the debug code must be designed for each description location of the optimization hint information and described in the source program. Therefore, it has a problem that high skills and large man-hours are required.

また、デバッグコードを記述する方法では、汎用的にデバッグコードを記述できる反面、エラーチェック箇所が多い場合には、デバッグコードのサイズが大きくなり、デバッグにも時間がかかるという課題を有している。   In addition, the debugging code can be written generically, but if there are many error check points, there is a problem that the debugging code becomes large and debugging takes time. .

さらに、最適化ヒント情報の記述が、コンパイル装置での最適化に使用されない場合には、プログラマは、その記述を削除して、エラーチェックを行わないようにすることもできるが、従来の方法では、最適化ヒント情報がコンパイル装置で最適化時に使用されたか否かが不明である。このため、そのようなことが不可能であった。   Furthermore, if the description of the optimization hint information is not used for optimization by the compiling device, the programmer can delete the description so that error checking is not performed. It is unclear whether or not the optimization hint information was used at the time of optimization by the compiling device. This made it impossible to do so.

本発明は、従来の課題を解決するためになされたものであり、プログラマに高いスキルと大きな工数とを要求することなく、最適化ヒント情報の正当性を判定することができるコンパイル装置等を提供することを目的とする。   The present invention has been made to solve the conventional problems, and provides a compiling device and the like that can determine the validity of optimization hint information without requiring high skill and large man-hours from a programmer. The purpose is to do.

また、デバッグコードのサイズが小さく、短時間で最適化ヒント情報の記述のエラーチェックを行なうことができるコンパイル装置等を提供することも目的とする。   It is another object of the present invention to provide a compiling device or the like that has a small debug code size and can perform error checking on the description of optimization hint information in a short time.

さらに、最適化ヒント情報が最適化で使用されない場合には、当該最適化ヒント情報を削除することができるコンパイル装置等を提供することも目的とする。   It is another object of the present invention to provide a compiling device or the like that can delete the optimization hint information when the optimization hint information is not used for optimization.

本発明に係るコンパイル装置は、高級言語で記述されたソースプログラムを機械語命令列に翻訳するコンパイル装置であって、機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて、ソースプログラムを最適化された機械語命令列に翻訳する翻訳手段と、前記指示を、ソースプログラム中より検出する指示検出手段と、検出された前記指示に基づいて、当該指示が不正か否かを判断可能な前記機械語命令列上の位置を検出する位置検出手段と、前記指示の前記ソースプログラム中での記述位置と、前記位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を生成するデバッグ情報生成手段とを備えることを特徴とする。   A compiling device according to the present invention is a compiling device that translates a source program written in a high-level language into a machine language instruction sequence, and based on instructions to the compiling device for optimizing the machine language instruction sequence, Can be determined whether or not the instruction is illegal based on the detected instruction, the translation means for translating the instruction into an optimized machine language instruction sequence, the instruction detecting means for detecting the instruction from the source program, and Position detecting means for detecting a position on the machine language instruction sequence, a description position of the instruction in the source program, the position, and information necessary for determining whether the instruction is invalid And debug information generating means for generating debug information including.

この構成によると、デバッグ装置が上記デバッグ情報を利用してエラーチェックを行うことにより、プログラマがデバッグコードを記述しなくても、上記指示(最適化ヒント情報)が不正か否かを判断することができる。このため、プログラマに高いスキルと大きな工数とを要求することなく、最適化ヒント情報の正当性を判定することができる。   According to this configuration, the debug device uses the debug information to perform an error check so that the programmer can determine whether or not the instruction (optimization hint information) is invalid without writing debug code. Can do. Therefore, it is possible to determine the validity of the optimization hint information without requiring a high skill and a large man-hour for the programmer.

好ましくは、前記指示は、C99言語(ISO(International Organization for Standardization)/IEC(International Electrotechnical Commission) 9899:1999 Programming language C)のrestrict記述であり、前記位置検出手段は、前記restrict記述により指定されたポインタ変数を介してメモリアクセスする命令の位置を検出し、前記指示が不正か否かを判断するために必要な情報は、前記変数と前記命令とを対応づける情報であることを特徴とする。   Preferably, the instruction is a restrictive description in a C99 language (ISO (International Organization for Standardization) / IEC (International Electrotechnical Commission) 9899: 1999 Programming language C), and the position detecting means is specified by the restrictive description. Information necessary for detecting the position of an instruction that accesses a memory via a pointer variable and determining whether the instruction is invalid is information that associates the variable with the instruction.

これにより、restrict記述のエラーチェックが可能となる。
また、前記指示は、関数におけるポインタ型の仮引数の指すメモリ領域のアラインメント値を指定するプラグマ指令であり、前記位置検出手段は、前記プラグマ指令で修飾された関数の先頭の命令の位置を検出し、前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定されたアラインメント値であってもよい。
Thereby, an error check of the restrict description can be performed.
The instruction is a pragma command that specifies an alignment value of a memory area pointed to by a pointer type dummy argument in the function, and the position detecting unit detects a position of a head instruction of the function modified by the pragma command. The information necessary for determining whether or not the instruction is illegal may be an alignment value specified by the pragma command.

これにより、上記プラグマ指令のエラーチェックが可能となる。
これにより、メモリ領域に関するプラグマ指令のエラーチェックが可能となる。
Thereby, the error check of the pragma command can be performed.
As a result, an error check of the pragma command relating to the memory area can be performed.

さらに、前記指示は、ループのイタレーション回数を指定するプラグマ指令であり、前記位置検出手段は、前記プラグマ指令で修飾されたループの直前の命令の位置を検出し、前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定される前記ループの直前で満たされるべき条件であってもよい。
これにより、繰り返し回数の情報を指定したプラグマ指令のエラーチェックが可能となる。
Further, the instruction is a pragma command that specifies the number of iterations of the loop, and the position detection unit detects the position of the instruction immediately before the loop modified by the pragma command, and determines whether the instruction is invalid. The information necessary to determine the condition may be a condition to be satisfied immediately before the loop specified by the pragma command.
As a result, an error check of the pragma command specifying the information on the number of repetitions can be performed.

さらに好ましくは、前記デバッグ情報生成手段は、最適化で利用された前記指示に対するデバッグ情報のみを生成するようにしてもよい。   More preferably, the debug information generating means may generate only debug information for the instruction used in the optimization.

これにより、不要なデバッグ情報の生成がなされず、デバッグ情報のサイズが削減できる。   Thereby, unnecessary debug information is not generated, and the size of the debug information can be reduced.

さらに好ましくは、上述のコンパイル装置は、さらに、前記指示が最適化で利用されたか否かを表示する表示手段を備えていてもよい。   More preferably, the above-described compiling device may further include a display unit that displays whether or not the instruction is used for optimization.

これにより、最適化ヒント情報記述がコンパイル装置で利用されたか否かが分かるので、プログラマは利用されない部分の最適化ヒント情報記述に関するテストを省略することができる。   As a result, it can be determined whether or not the optimization hint information description has been used in the compiling device, so that the programmer can omit the test relating to the optimization hint information description of the portion that is not used.

本発明の他の局面に係るデバッグ装置は、高級言語で記述されたソースプログラムを、機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて翻訳した結果である機械語命令列を実行しながら当該機械語命令列の誤りを検出するデバッグ装置であって、機械語命令列を読み込む機械語命令列読み込み手段と、前記指示の前記ソースプログラム中での記述位置と、当該指示が不正か否かを判断可能な前記機械語命令列上の位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を読み込むデバッグ情報読み込み手段と、前記機械語命令列読み込み手段で読み込まれた前記機械語命令列を実行する実行手段と、前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する判断手段とを備えることを特徴とする。   A debugging device according to another aspect of the present invention executes a machine language instruction sequence that is a result of translating a source program described in a high-level language based on instructions to a compiling device for optimizing a machine language instruction sequence. A debugging device for detecting an error in the machine language instruction sequence while reading a machine language instruction sequence, a description position in the source program of the instruction, and whether the instruction is invalid Debug information reading means for reading debug information including a position on the machine language instruction sequence from which it can be determined and information necessary for determining whether the instruction is invalid, and reading the machine language instruction sequence Execution means for executing the machine language instruction sequence read by the means, and a position on the machine language instruction sequence from which it can be determined whether or not the instruction is illegal based on the debug information. When definitive machine instructions executed, the indication is characterized in that it comprises a determining means for determining fraudulent or.

この構成によると、最適化ヒント情報の記述のエラーチェックをデバッグ装置により自動で行うことができ、エラーが検出された場合、ソースプログラムの該当箇所を特定することができる。   According to this configuration, the error check of the description of the optimization hint information can be automatically performed by the debugging device, and when an error is detected, the corresponding part of the source program can be specified.

また、上述のデバッグ装置は、さらに、前記判断手段による判断処理を行なうかまたは行なわないかを切り替えるための切り替え手段を備えていてもよい。   The debugging device described above may further include a switching unit for switching whether or not to perform the determination process by the determination unit.

また、上述のデバッグ装置は、さらに、前記機械語命令列読み込み手段が読み込む機械語命令列に対応するソースプログラムと、前記デバッグ情報読み込み手段が読み込むデバッグ情報との指定を受け付ける受け付け手段を備え、前記デバッグ情報読み込み手段は、前記受け付け手段で指定されたデバッグ情報を読み込み、前記判断手段は、前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記ソースプログラムに対応する前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断するようにしてもよい。   The debugging device further includes a receiving unit that receives a designation of a source program corresponding to the machine language instruction sequence read by the machine language instruction sequence reading unit and debug information read by the debug information reading unit, Debug information reading means reads the debug information designated by the accepting means, and the determining means is based on the debug information, and the machine language corresponding to the source program capable of determining whether or not the instruction is illegal. When executing the machine language instruction at the position on the instruction sequence, it may be determined whether or not the instruction is invalid.

また、上述のデバッグ装置は、さらに、前記ソースプログラム中の関数の指定を受け付ける関数指定受け付け手段を備え、前記判断手段は、前記デバッグ情報に基づいて、前記関数指定受け付け手段で指定された関数のみに対して、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断するようにしてもよい。   The debugging device further includes a function designation accepting unit that accepts designation of a function in the source program, and the determining unit is configured to use only the function designated by the function designation accepting unit based on the debug information. On the other hand, when the machine language instruction is executed at a position on the machine language instruction sequence where it can be determined whether the instruction is invalid, it may be determined whether the instruction is illegal.

これにより、必要な部分のみエラーチェックが可能となり、デバッグ効率を改善できる。   As a result, error checking can be performed only on necessary portions, and debugging efficiency can be improved.

なお、本発明は、このような特徴的な手段を備えるコンパイル装置やデバッグ装置として実現することができるだけでなく、コンパイル装置とデバッグ装置とを備えるコンパイルシステムとして実現したり、コンパイル装置やデバッグ装置が備える特徴的な手段をステップとするコンパイル方法やデバッグ方法として実現したりすることもできる。また、コンパイル方法やデバッグ方法に含まれる特徴的なステップをコンピュータに実行させるコンパイラやデバッガとして実現することもできる。そして、そのようなコンパイラやデバッガは、CD−ROM等の記録媒体やインターネット等の通信ネットワークを介して流通させることができるのは言うまでもない。   Note that the present invention can be realized not only as a compile apparatus and a debug apparatus including such characteristic means, but also as a compile system including a compile apparatus and a debug apparatus. It can also be realized as a compiling method or a debugging method using characteristic means provided as steps. It can also be realized as a compiler or debugger that causes a computer to execute characteristic steps included in the compiling method and debugging method. Needless to say, such a compiler or debugger can be distributed via a recording medium such as a CD-ROM or a communication network such as the Internet.

本発明によると、プログラマに高いスキルと大きな工数とを要求することなく、最適化ヒント情報の正当性を判定することができるコンパイル装置等を提供することができる。   According to the present invention, it is possible to provide a compiling device or the like that can determine the validity of optimization hint information without requiring a programmer with high skill and large man-hours.

また、デバッグコードのサイズが小さく、短時間で最適化ヒント情報の記述のエラーチェックを行なうことができるコンパイル装置等を提供するができる。   Further, it is possible to provide a compiling device or the like in which the size of the debug code is small and the error check of the description of the optimization hint information can be performed in a short time.

さらに、最適化ヒント情報が最適化で使用されない場合には、当該最適化ヒント情報を削除することができるコンパイル装置等を提供することができる。   Furthermore, when the optimization hint information is not used for optimization, a compiling device or the like that can delete the optimization hint information can be provided.

以下本発明を実施するための最良の形態について、図面を参照しながら説明する。
図1は、本発明の実施の形態に係るコンパイルシステムの構成を示す機能ブロック図である。便宜上、図1にはソースプログラム101およびソースプログラムの翻訳結果である機械語プログラム107も併せて記載している。
The best mode for carrying out the present invention will be described below with reference to the drawings.
FIG. 1 is a functional block diagram showing a configuration of a compilation system according to an embodiment of the present invention. For convenience, FIG. 1 also shows a source program 101 and a machine language program 107 which is a translation result of the source program.

コンパイルシステム100は、ソースプログラムを機械語命令列に翻訳すると同時に、ソースプログラムに含まれる最適化ヒント情報の記述に誤りがないかをチェックするシステムであり、コンパイル装置102と、デバッグ装置108とを備えている。   The compiling system 100 is a system that translates a source program into a machine language instruction sequence, and at the same time checks whether there is an error in the description of the optimization hint information included in the source program. I have.

コンパイル装置102は、ソースプログラム101を入力として、機械語命令列107aに翻訳して機械語プログラム107として出力するとともに、最適化ヒント情報の記述のエラーチェックを行うための最適化ヒント情報記述デバッグ情報107bも併せて出力する装置であり、最適化ヒント情報記述検出部103と、コード最適化部104と、エラーチェックポイント検出部105と、最適化ヒント記述デバッグ情報生成部106とを備えている。   The compiling device 102 receives the source program 101 as an input, translates it into a machine language instruction sequence 107a, outputs it as a machine language program 107, and optimizes hint information description debug information for performing an error check on the description of optimization hint information. Reference numeral 107b also denotes an output device that includes an optimization hint information description detection unit 103, a code optimization unit 104, an error checkpoint detection unit 105, and an optimization hint description debug information generation unit 106.

最適化ヒント情報記述検出部103は、ソースプログラム含まれる最適化ヒント情報記述を検出する処理部である。   The optimization hint information description detection unit 103 is a processing unit that detects an optimization hint information description included in the source program.

コード最適化部104は、最適化ヒント情報記述検出部103で検出された最適化ヒント情報を利用して、コードの最適化を行う処理部である。   The code optimization unit 104 is a processing unit that performs code optimization using the optimization hint information detected by the optimization hint information description detection unit 103.

エラーチェックポイント検出部105は、コード最適化部104で最適化されたコードのうち、最適化ヒント情報記述検出部103で検出された最適化ヒント情報記述が不正か否かをチェックできる命令のアドレスを検出する処理部である。   The error checkpoint detection unit 105 is an address of an instruction that can check whether or not the optimization hint information description detected by the optimization hint information description detection unit 103 is invalid among the codes optimized by the code optimization unit 104 Is a processing unit for detecting.

最適化ヒント情報記述デバッグ情報生成部106は、最適化ヒント情報記述検出部103で検出された最適化ヒント情報の記述場所と、エラーチェックポイント検出部105で検出された命令のアドレスと、エラーチェックを行うのに必要な情報とからなる最適化ヒント情報記述デバッグ情報107bを生成する処理部である。   The optimization hint information description debug information generation unit 106 includes a description location of the optimization hint information detected by the optimization hint information description detection unit 103, an instruction address detected by the error checkpoint detection unit 105, and an error check. It is a processing unit that generates optimization hint information description debug information 107b including information necessary for performing the above.

デバッグ装置108は、機械語命令列107aをデバッグするとともに、最適化ヒント情報の記述に誤りがないかをチェックする装置であり、入力部109と、実行エンジン110と、機械語命令列記憶部111と、デバッグ情報記憶部112と、エラーチェック部113と、エラーメッセージ表示部114とを備えている。   The debugging device 108 is a device that debugs the machine language instruction sequence 107a and checks whether there is an error in the description of the optimization hint information, and includes an input unit 109, an execution engine 110, and a machine language instruction sequence storage unit 111. A debug information storage unit 112, an error check unit 113, and an error message display unit 114.

機械語命令列記憶部111は、機械語命令列107aを記憶する記憶装置である。
デバッグ情報記憶部112は、デバッグ装置108で取り扱いやすいように変換された最適化ヒント情報記述デバッグ情報112bを記憶する記憶装置である。
The machine language instruction sequence storage unit 111 is a storage device that stores a machine language instruction sequence 107a.
The debug information storage unit 112 is a storage device that stores the optimization hint information description debug information 112b converted so as to be easily handled by the debug device 108.

入力部109は、機械語プログラム107を読み込み、機械語プログラム107に含まれる機械語命令列107aを機械語命令列記憶部111に格納するとともに、最適化ヒント情報記述デバッグ情報107bをデバッグ装置108が取り扱い形に変換し、最適化ヒント情報記述デバッグ情報112bとして格納する処理部である。   The input unit 109 reads the machine language program 107, stores the machine language instruction sequence 107a included in the machine language program 107 in the machine language instruction sequence storage unit 111, and the debugging device 108 receives the optimization hint information description debug information 107b. It is a processing unit that converts it into a handling form and stores it as optimization hint information description debug information 112b.

実行エンジン110は、機械語命令列記憶部111に格納された機械語命令列107aを順番に実行する処理部である。   The execution engine 110 is a processing unit that sequentially executes the machine language instruction sequence 107 a stored in the machine language instruction sequence storage unit 111.

エラーチェック部113は、実行エンジン109で実行される機械語命令列107aの実行アドレスが、デバッグ情報記憶部112に記憶されている最適化ヒント情報記述デバッグ情報112bのエラーチェックポイントのアドレスと一致した際に起動され、デバッグ情報記憶部112に格納されている最適化ヒント情報記述デバッグ情報112bを利用して、最適化ヒント情報の記述のエラーチェックを行う処理部である。   In the error check unit 113, the execution address of the machine language instruction sequence 107a executed by the execution engine 109 matches the address of the error check point of the optimization hint information description debug information 112b stored in the debug information storage unit 112. This is a processing unit that is activated at this time and performs an error check on the description of the optimization hint information using the optimization hint information description debug information 112b stored in the debug information storage unit 112.

エラーメッセージ表示部114は、エラーチェック部113でエラーが検出された場合に起動され、最適化ヒント情報記述デバッグ情報112bに含まれるソースプログラム101の行番号を含むエラーメッセージを出力する。   The error message display unit 114 is activated when an error is detected by the error check unit 113, and outputs an error message including the line number of the source program 101 included in the optimization hint information description debug information 112b.

次に、上述の構成を備えるコンパイルシステム100の動作について、説明する。
(動作例1)
まず、最適化ヒント情報の記述としてC99言語のrestrict記述を含むソースプログラム101を一例として、コンパイルシステム100の動作について説明する。
Next, the operation of the compilation system 100 having the above-described configuration will be described.
(Operation example 1)
First, the operation of the compilation system 100 will be described by taking the source program 101 including the C99 language restriction description as an example of the optimization hint information.

図2は、restrict記述を含むソースプログラム101の一例を示す図である。ソースプログラム101のl01行目に示されているrestrict記述は、ポインタpを介したメモリアクセスp[i]と、ポインタqを介したメモリアクセスq[i]とで、アクセスするメモリ領域が重ならないことを、プログラマが保証してコンパイル装置102に知らせるためのものである。   FIG. 2 is a diagram illustrating an example of the source program 101 including a restrict description. In the restrict description shown in the l01th line of the source program 101, the memory areas to be accessed do not overlap in the memory access p [i] via the pointer p and the memory access q [i] via the pointer q. This is for the programmer to ensure that this is informed to the compiling device 102.

図3は、restrict記述の情報を利用しないで、ソースプログラム101を翻訳した結果の機械語命令列を示す図である。また、図4は、restrict記述の情報を利用して、ソースプログラム101をコンパイルした結果の機械語命令列107aを示す図である。ここで、機械語命令列が動作するアーキテクチャマシンは、命令レベルで並列実行が3命令まで可能なマシンであるとする。   FIG. 3 is a diagram illustrating a machine language instruction sequence obtained as a result of translating the source program 101 without using the information in the restrict description. FIG. 4 is a diagram showing a machine language instruction sequence 107a obtained as a result of compiling the source program 101 using the information in the restrict description. Here, it is assumed that the architecture machine on which the machine language instruction sequence operates is a machine that can execute up to three instructions in parallel at the instruction level.

コンパイル装置102が機械語命令列の並び方を最適にすることにより、並列実行の割合を増やすことができ、機械語命令列の実行性能を向上させることが可能となる。ここで、機械語命令の意味は、以下の通りである。   When the compiling device 102 optimizes the arrangement of the machine language instruction sequence, the parallel execution ratio can be increased, and the execution performance of the machine language instruction sequence can be improved. Here, the meaning of the machine language instruction is as follows.

「Mov r3,0」は、定数0をレジスタr3に格納する。
「Ld r2,(r1+)」は、レジスタr1の指し示すメモリ領域の内容をレジスタr2にロードした後、レジスタr1の値を次のメモリ領域を指すように更新する。
“Mov r3, 0” stores the constant 0 in the register r3.
“Ld r2, (r1 +)” loads the contents of the memory area pointed to by the register r1 into the register r2, and then updates the value of the register r1 to point to the next memory area.

「Add r3,r3,1」は、レジスタr3の値に1加算した値をレジスタr3に格納する。   “Add r3, r3, 1” stores a value obtained by adding 1 to the value of the register r3 in the register r3.

「Cmp r3,100」は、レジスタr3の値と100とを比較する。
「St (r0+),r2」は、レジスタr2の値をレジスタr0の指し示すメモリ領域にストアした後、レジスタr0の値を次のメモリ領域を指すように更新する。
“Cmp r3, 100” compares the value of the register r3 with 100.
“St (r0 +), r2” stores the value of the register r2 in the memory area indicated by the register r0, and then updates the value of the register r0 to indicate the next memory area.

「Brlt Label1」は、Cmp命令の比較結果において、第1オペランドの値よりも第2オペランドの値のほうが大きかった場合には、Label1に分岐する。   “Brlt Label1” branches to Label1 if the value of the second operand is greater than the value of the first operand in the comparison result of the Cmp instruction.

ここで、restrict記述の情報を利用しない場合には、Ld命令とSt命令の順序を入れかえることができない。ため、図1のソースプログラム101は、図3の機械語命令列に翻訳される。この場合、アドレスa302〜a307で示されるループの実行サイクル数は、300サイクルとなる。これは、アドレスa302の命令とアドレスa303の命令とが並列実行可能であり、また、アドレスa304の命令とアドレスa305の命令とが並列実行可能であり、さらにアドレスa306の命令とアドレスa307の命令とが並列実行可能であるため、3*100=300という計算式により求められる。それに、アドレスa301のMov命令を実行するために必要な1サイクルを加えた301サイクルが、図3に示された機械語命令列を実行するために必要なサイクル数である。   Here, when the information in the restrict description is not used, the order of the Ld instruction and the St instruction cannot be interchanged. Therefore, the source program 101 in FIG. 1 is translated into the machine language instruction sequence in FIG. In this case, the number of execution cycles of the loop indicated by the addresses a302 to a307 is 300. This is because the instruction at address a302 and the instruction at address a303 can be executed in parallel, the instruction at address a304 and the instruction at address a305 can be executed in parallel, and the instruction at address a306 and the instruction at address a307 Can be executed in parallel, it is obtained by the calculation formula 3 * 100 = 300. In addition, 301 cycles including one cycle necessary for executing the Mov instruction at the address a301 is the number of cycles necessary for executing the machine language instruction sequence shown in FIG.

一方、restrict記述の情報を利用して最適化を行った場合は、Ld命令とSt命令の順序変更が可能となる。このため、図1に示されるソースプログラム101は、図4に示される機械語命令列107aに翻訳される。ここで行われている最適化技術は、「ソフトウェアパイプライニング」と呼ばれる既存の技術である。このため、その詳しい説明は省略する。   On the other hand, when optimization is performed using the information in the restrict description, the order of the Ld instruction and the St instruction can be changed. Therefore, the source program 101 shown in FIG. 1 is translated into a machine language instruction sequence 107a shown in FIG. The optimization technique performed here is an existing technique called “software pipelining”. Therefore, detailed description thereof is omitted.

ソフトウェアパイプライニングによる最適化を行なうことにより、(n+1)回目のループイタレーションにおけるLd命令をn回目のループイタレーションにおけるSt命令よりも先に行うことが可能となる。このため、図4に示されるような機械語命令列107aが生成される。この場合、機械語命令列107aを実行するために必要なサイクル数は、202サイクルとなる。これは、以下のようにして求められる。すなわち、アドレスa404〜a406に配置された3つの命令は並列に実行可能であり、アドレスa407〜a409に配置された3つの命令も並列実行可能であり、それら6命令のイタレーションが99回行なわれる。また、イタレーション以外の処理として、a401〜a403と、a410と、a420の5つの命令があるが、このうち、a402とa403とは並列実行可能であるため、これらの5つの命令は4サイクルで実行可能である。したがって、上述のサイクル数は、2*99+4=202サイクルとして求められる。   By performing optimization by software pipelining, the Ld instruction in the (n + 1) th loop iteration can be executed before the St instruction in the nth loop iteration. Therefore, a machine language instruction sequence 107a as shown in FIG. 4 is generated. In this case, the number of cycles necessary to execute the machine language instruction sequence 107a is 202 cycles. This is determined as follows. That is, three instructions arranged at addresses a404 to a406 can be executed in parallel, and three instructions arranged at addresses a407 to a409 can also be executed in parallel. These six instructions are iterated 99 times. . As processing other than iteration, there are five instructions a401 to a403, a410, and a420. Of these, a402 and a403 can be executed in parallel, so these five instructions are executed in four cycles. It is feasible. Therefore, the number of cycles described above is obtained as 2 * 99 + 4 = 202 cycles.

サイクル数を比較すると、図3の機械語命令列に比べて、図4の機械語命令列のほうが実行性能が向上している。しかし、restrict記述が誤っており、順番をかえてはいけない命令の順番をかえてしまっていた場合には、実行結果が不正となる。このため、restrict記述が誤っているか否かをチェックするために、コンパイルシステム100の各処理部は以下に示すような処理を実行する。   Comparing the number of cycles, the execution performance of the machine language instruction sequence of FIG. 4 is improved compared to the machine language instruction sequence of FIG. However, if the restrict description is incorrect and the order of instructions that should not be changed is changed, the execution result becomes invalid. For this reason, in order to check whether or not the restriction description is incorrect, each processing unit of the compilation system 100 executes the following processing.

図5は、最適化ヒント情報記述検出部103の動作を示すフローチャートである。
最適化ヒント情報記述検出部103は、ソースプログラム101を1行ずつ読み込む(ステップS501)。
FIG. 5 is a flowchart showing the operation of the optimization hint information description detection unit 103.
The optimization hint information description detection unit 103 reads the source program 101 line by line (step S501).

最適化ヒント情報記述検出部103は、ソースプログラム101中にrestrict記述が存在するか否かを検出する(ステップS502)。restrict記述を検出した場合には(ステップS502でyes)、その記述行と指定された変数の情報とを記憶する(ステップS503)。図2に示したソースプログラム101の場合には、l01行目のポインタ変数pとqのrestrict記述が検出され、記憶される。これをソースプログラム101の読み込みが終了するまで、1行ずつ繰り返す(ステップS504)。   The optimization hint information description detecting unit 103 detects whether or not the restrict description exists in the source program 101 (step S502). If a restrict description is detected (yes in step S502), the description line and information on the designated variable are stored (step S503). In the case of the source program 101 shown in FIG. 2, the restrict description of the pointer variables p and q on the 101st line is detected and stored. This is repeated line by line until the reading of the source program 101 is completed (step S504).

コード最適化部104では、最適化ヒント情報記述検出部103で検出したrestrict記述の情報を利用して、コード最適化を行い、図2のソースプログラム101を図4の機械語命令列107aに変換する。ここで、コード最適化部104の処理は、一般のコンパイル装置の処理と同様であるので、詳細な説明は省略する。   The code optimizing unit 104 performs code optimization using the information of the restriction description detected by the optimization hint information description detecting unit 103, and converts the source program 101 in FIG. 2 into the machine language instruction sequence 107a in FIG. To do. Here, the processing of the code optimization unit 104 is the same as the processing of a general compiling device, and thus detailed description thereof is omitted.

図6は、エラーチェックポイント検出部105の動作を示すフローチャートである。
エラーチェックポイント検出部105は、コード最適化部104で、最適化を行った結果の機械語命令に1行ずつ着目する(ステップS601)。
FIG. 6 is a flowchart showing the operation of the error checkpoint detection unit 105.
The error checkpoint detection unit 105 pays attention to the machine language instruction as a result of optimization performed by the code optimization unit 104 line by line (step S601).

エラーチェックポイント検出部105は、着目した機械語命令がメモリアクセス命令か否かを判定する(ステップS602)。メモリアクセス命令の場合には(S602でyes)、そのメモリアクセスがrestrict記述で指定されたポインタ変数を介したメモリアクセスに相当する命令か否かを判定する(ステップS603)。この判定は、変数割り付け等の資源割り付けを行なった結果の情報を利用して行なわれる。   The error checkpoint detection unit 105 determines whether or not the focused machine language instruction is a memory access instruction (step S602). In the case of a memory access instruction (yes in S602), it is determined whether or not the memory access is an instruction corresponding to a memory access via a pointer variable designated by the restrict description (step S603). This determination is performed using information on the result of resource allocation such as variable allocation.

restrict記述指定されたポインタ変数を介したメモリアクセスであった場合には(S603でyes)、命令のアドレスをそのrestrict記述で指定されたポインタ変数のエラーチェックポイントとして記憶する(ステップS604)。図4の機械語命令列107aの場合は、アドレスa407とアドレスa420のSt命令が、図2のrestrict記述で指定されたポインタ変数pを介したメモリアクセスであるので、ポインタ変数pのエラーチェックポイントとして、記憶される。また、アドレスa402とアドレスa406のLd命令が、図2のrestrict記述で指定されたポインタ変数qを介したメモリアクセス命令であるので、ポインタ変数qのエラーチェックポイントとして記憶される。   If the memory access is via a pointer variable designated by the restrict description (Yes in S603), the address of the instruction is stored as an error checkpoint of the pointer variable designated by the restrict description (step S604). In the case of the machine language instruction sequence 107a in FIG. 4, the St instruction at the address a407 and the address a420 is a memory access via the pointer variable p specified by the restrict description in FIG. As stored. Further, since the Ld instructions at the addresses a402 and a406 are memory access instructions via the pointer variable q designated by the restrict description in FIG. 2, they are stored as error checkpoints for the pointer variable q.

以上の処理により、最適化ヒント情報記述デバッグ情報生成部103で生成される、図2のソースプログラム101のrestrict記述に対する最適化ヒント情報記述デバッグ情報の概念図は、図7のようになる。すなわち、restrict記述がされているソースプログラム101中の行情報として、ソースプログラム101のファイル名と行番号との組「FileName:l01」とが記憶されている。また、その行に含まれるrestrict記述で指定されたポインタ変数としてpおよびqが記憶されている。さらに、ポインタ変数pのエラーチェックポイントとして、アドレスa407およびa402が、メモリアクセス命令アドレス情報に格納され、ポインタ変数qのエラーチェックポイントとして、アドレスa402およびa406が、メモリアクセス命令アドレス情報に格納されている。   FIG. 7 shows a conceptual diagram of the optimization hint information description debug information generated by the optimization hint information description debug information generation unit 103 by the above processing for the restriction description of the source program 101 of FIG. In other words, a set “FileName: 1001” of the file name and line number of the source program 101 is stored as line information in the source program 101 in which the restrict description is described. In addition, p and q are stored as pointer variables specified by the restrict description included in the row. Further, addresses a407 and a402 are stored in the memory access instruction address information as error checkpoints of the pointer variable p, and addresses a402 and a406 are stored in the memory access instruction address information as error checkpoints of the pointer variable q. Yes.

コンパイル装置102は、ソースプログラム101の翻訳結果として、図4に示される機械語命令列107aと図7に示される最適化ヒント情報記述デバッグ情報107bとが格納された機械語プログラム107を出力する。   The compiling device 102 outputs the machine language program 107 in which the machine language instruction sequence 107a shown in FIG. 4 and the optimization hint information description debug information 107b shown in FIG. 7 are stored as the translation result of the source program 101.

次に、デバッグ装置108の実行する処理について説明する。
デバッグ装置108の入力部109は、図4に示される機械語命令列107aと図7に示される最適化ヒント情報記述デバッグ情報107bとが格納された機械語プログラム107を読み込み、機械語命令列107aを機械語命令列記憶部111に格納する。また、入力部109は、図7に示される最適化ヒント情報記述デバッグ情報107bを、図8に示されるデバッグ装置でエラーチェックが行える形式の最適化ヒント情報記述デバッグ情報112bに変換して、デバッグ情報記憶部112に格納する。デバッグ情報記憶部112には、メモリアクセス情報も格納される。ここで、メモリアクセス情報は、エラーチェックに使われる情報で、最初は何の情報も格納されていない。たとえば、図8に示されるメモリアクセス情報には、アドレスa407で示される命令実行時にアクセスされるメモリ情報等が格納されることになるが、最初は何の情報も記憶されていない。
Next, processing executed by the debugging device 108 will be described.
The input unit 109 of the debugging device 108 reads the machine language program 107 in which the machine language instruction sequence 107a shown in FIG. 4 and the optimization hint information description debug information 107b shown in FIG. 7 are stored, and the machine language instruction sequence 107a. Is stored in the machine language instruction sequence storage unit 111. Further, the input unit 109 converts the optimization hint information description debug information 107b shown in FIG. 7 into optimization hint information description debug information 112b in a format in which an error check can be performed by the debug device shown in FIG. The information is stored in the information storage unit 112. The debug information storage unit 112 also stores memory access information. Here, the memory access information is information used for error checking, and no information is stored at first. For example, the memory access information shown in FIG. 8 stores memory information or the like accessed when the instruction indicated by the address a407 is executed, but no information is stored at first.

図9は、実行エンジン110による機械語命令列実行時の動作を示すフローチャートである。   FIG. 9 is a flowchart showing an operation when the execution language 110 is executed by the execution engine 110.

実行エンジン110は、機械語命令列記憶部111に格納されている機械語命令列107aのアドレスを順次取得する(ステップS901)。   The execution engine 110 sequentially acquires the addresses of the machine language instruction sequence 107a stored in the machine language instruction sequence storage unit 111 (step S901).

実行エンジン110は、取得したアドレスが、最適化ヒント情報記述デバッグ情報112bに格納されているエラーチェックポイントのアドレスに一致するか否かを判定する(ステップS902)。   The execution engine 110 determines whether or not the acquired address matches the error checkpoint address stored in the optimization hint information description debug information 112b (step S902).

判定結果が真であれば(ステップS902でyes)、実行エンジン110は、エラーチェック部113を起動する(ステップS903)。その後、実行エンジン110は、取得されたアドレスで示される機械語命令を実行する(ステップS904)。実行の結果、機械語命令列107aの処理が終了していなければ(S905でno)、次に実行される機械語命令のアドレスを取得し(S902)、同様の処理を、機械語命令列107aの処理が終了するまで繰り返す。   If the determination result is true (yes in step S902), the execution engine 110 activates the error check unit 113 (step S903). Thereafter, the execution engine 110 executes the machine language instruction indicated by the acquired address (step S904). If the processing of the machine language instruction sequence 107a is not completed as a result of the execution (No in S905), the address of the machine language instruction to be executed next is acquired (S902), and the same processing is performed as the machine language instruction sequence 107a. Repeat until the process is completed.

図4に示した機械語命令列107aの例では、アドレスa402,a406,a407およびa409がエラーチェックポイントのアドレスである。このため、それぞれのアドレスで示される命令の実行前に、エラーチェック部113が起動される。   In the example of the machine language instruction sequence 107a shown in FIG. 4, the addresses a402, a406, a407, and a409 are error checkpoint addresses. For this reason, the error check unit 113 is activated before the instruction indicated by each address is executed.

図10は、エラーチェック部113の動作を示すフローチャートである。エラーチェック部113は、最初に、機械語命令がアクセスするメモリ領域を取得する(ステップS101)。restrict記述の場合は、エラーチェックポイントに存在する命令は、メモリアクセス命令であるので、必ずアクセスするメモリ領域が取得できる。   FIG. 10 is a flowchart showing the operation of the error check unit 113. The error check unit 113 first acquires a memory area accessed by the machine language instruction (step S101). In the case of the restrict description, since the instruction existing at the error check point is a memory access instruction, the memory area to be accessed can always be acquired.

次に、エラーチェック部113は、最適化ヒント情報記述デバッグ情報112bのうち、上述の機械語命令のアドレスに対応するメモリアクセス情報以外のメモリアクセス情報に着目する(ステップS102)。たとえば、機械語命令のアドレスがa407の場合には、アドレスa402およびa406に対応するメモリアクセス情報に着目する。   Next, the error check unit 113 focuses on memory access information other than the memory access information corresponding to the address of the machine language instruction in the optimization hint information description debug information 112b (step S102). For example, when the address of the machine language instruction is a407, attention is focused on the memory access information corresponding to the addresses a402 and a406.

エラーチェック部113は、上述の機械語命令のアドレスに対応するメモリアクセス情報と、それ以外のメモリアクセス情報とを比較し、メモリアクセス領域に重なりがあるか否かを判定する(ステップS103)。   The error check unit 113 compares the memory access information corresponding to the address of the machine language instruction described above with the other memory access information, and determines whether there is an overlap in the memory access areas (step S103).

重なりがあると判定された場合には(ステップS103でyes)、対応するrestrict記述の不正が検出されたということなので、エラーチェック部113は、エラーメッセージ表示部114を起動する(ステップS106)。   If it is determined that there is an overlap (Yes in step S103), it means that the corresponding restriction description is invalid, and the error check unit 113 activates the error message display unit 114 (step S106).

重なりがないと判定された場合には(ステップS103でno)、上述の機械語命令のアドレスに対応するメモリアクセス情報以外のすべてのメモリアクセス情報について着目済みか否かを判断する(ステップS104)。未着目のメモリアクセス情報が存在する場合には(S104でno)、S102以降の処理を繰り返す。   If it is determined that there is no overlap (No in step S103), it is determined whether or not all memory access information other than the memory access information corresponding to the address of the machine language instruction has been noted (step S104). . If unfocused memory access information exists (no in S104), the processing from S102 onward is repeated.

不正が検出されなかった場合には(S104でyes)、上述の機械語命令のアドレスに対応するメモリアクセス情報に、その機械語命令でアクセスするメモリ領域を追加する(ステップS105)。   If fraud is not detected (yes in S104), a memory area accessed by the machine language instruction is added to the memory access information corresponding to the address of the machine language instruction (step S105).

たとえば、図4の機械語命令列107aにおいて、アドレスa401で示される命令実行前のレジスタr0の値を0x8004、レジスタr1の値を0x8000とする。最初に、アドレスa402で示される命令の実行前に、エラーチェック部113が呼び出されるが、その場合の最適化ヒント情報記述デバッグ情報112bは、図8に示すような状態である。このため、ポインタ変数pが指す領域と、ポインタ変数qが指す領域との重なりは存在せず、メモリアクセス情報が更新され、最適化ヒント情報記述デバッグ情報112bが図11に示されるようなものになる。ここで、(0x8000,4)は、0x8000番地から、4バイト分のメモリ領域がアクセスされることを表す。   For example, in the machine language instruction sequence 107a of FIG. 4, the value of the register r0 before the instruction execution indicated by the address a401 is 0x8004, and the value of the register r1 is 0x8000. First, the error check unit 113 is called before the execution of the instruction indicated by the address a402. In this case, the optimization hint information description debug information 112b is in a state as shown in FIG. Therefore, there is no overlap between the area pointed to by the pointer variable p and the area pointed to by the pointer variable q, the memory access information is updated, and the optimization hint information description debug information 112b is as shown in FIG. Become. Here, (0x8000, 4) represents that a 4-byte memory area is accessed from address 0x8000.

次に、アドレスa406の命令実行前に、エラーチェック部113が呼び出されるが、その場合の最適化ヒント情報記述デバッグ情報112bは、図11の状態なので、ポインタ変数pが指す領域と、ポインタ変数qが指す領域との重なりは存在せず、メモリアクセス情報が更新され、最適化ヒント情報記述デバッグ情報112bの情報は図12に示されるものとなる。   Next, the error check unit 113 is called before the execution of the instruction at the address a406. In this case, the optimization hint information description debug information 112b is in the state shown in FIG. The memory access information is updated and the information of the optimization hint information description debug information 112b is as shown in FIG.

次に、アドレスa407実行前に、エラーチェック部113が呼び出されるが、その場合の最適化ヒント情報記述デバッグ情報112bは、図12の状態なので、ポインタ変数pが指す領域と、ポインタ変数qが指す領域との重なりが存在するため、エラーメッセージ表示部114が起動される。   Next, the error check unit 113 is called before the execution of the address a407. Since the optimization hint information description debug information 112b in this case is in the state shown in FIG. 12, the area pointed to by the pointer variable p and the pointer variable q point to. Since there is an overlap with the area, the error message display unit 114 is activated.

エラーメッセージ表示部114は、エラーを検出したrestrict記述が記述されているソースプログラム101のファイル名、行情報を最適化ヒント情報記述デバッグ情報112bから取得し、ファイル名、行情報を含むエラーメッセージを表示する。   The error message display unit 114 acquires the file name and line information of the source program 101 in which the restrict description that detected the error is described from the optimization hint information description debug information 112b, and displays an error message including the file name and line information. indicate.

なお、エラーメッセージを表示する変わりに、該当ソースプログラム101を表示して、該当行の文字を反転させるなどして、プログラマにエラー箇所を知らせるようにしてもよい。   Instead of displaying the error message, the corresponding source program 101 may be displayed to invert the characters on the corresponding line to notify the programmer of the error location.

以上のような処理を行なうことにより、誤ったrestrict記述を検出することができる。
(動作例2)
次に、最適化ヒント情報記述としてポインタ型の仮引数の指すメモリ領域のアラインメントを指定するプラグマ指令がソースプログラム101に含まれている場合のコンパイルシステム100の動作について説明する。
By performing the processing as described above, an erroneous restrict description can be detected.
(Operation example 2)
Next, the operation of the compiling system 100 when the source program 101 includes a pragma command that specifies the alignment of the memory area pointed to by the pointer type dummy argument as the optimization hint information description will be described.

図13は、上述のプラグマ指令を含むソースプログラムの一例を示す図である。
ソースプログラム101中のプラグマ指令「#pragma _pointing_align=4 a」は、ポインタ型仮引数aの指すメモリ領域が、関数が呼び出された時点で4バイトアラインメントされていることをプログラマがコンパイル装置102に知らせるためのものである。
FIG. 13 is a diagram illustrating an example of a source program including the pragma command described above.
The pragma command “# pragma_pointing_align = 4a” in the source program 101 tells the compiling device 102 that the memory area pointed to by the pointer-type dummy argument a is 4-byte aligned when the function is called. Is for.

図14は、プラグマ指令の情報を利用しないで、翻訳した結果の機械語命令列を示す図である。また、図15は、プラグマ指令の情報を利用してコンパイルした結果の機械語命令列107aを示す図である。ここで、機械語命令の意味は、以下の通りである。   FIG. 14 is a diagram illustrating a machine language instruction sequence obtained as a result of translation without using the information of the pragma instruction. FIG. 15 is a diagram illustrating a machine language instruction sequence 107a obtained as a result of compiling using pragma command information. Here, the meaning of the machine language instruction is as follows.

「Ldb r2,(r1+)」は、レジスタr1の指し示す1バイトのメモリ領域の内容をレジスタr2にロードした後、レジスタr1の値を次のメモリ領域を指すように更新する。   “Ldb r2, (r1 +)” loads the contents of the 1-byte memory area indicated by the register r1 into the register r2, and then updates the value of the register r1 to indicate the next memory area.

「Stb (r0+),r2」は、レジスタr2の値をレジスタr0の指し示す1バイトのメモリ領域にストアした後、レジスタr0の値を次のメモリ領域を指すように更新する。1バイトのロード、ストアの場合は、アクセスするメモリ領域に何の制約もない。   “Stb (r0 +), r2” stores the value of the register r2 in the 1-byte memory area indicated by the register r0, and then updates the value of the register r0 to indicate the next memory area. In the case of 1-byte load / store, there is no restriction on the memory area to be accessed.

「Ld r2,(r1+)」は、レジスタr1の指し示す4バイトのメモリ領域の内容をレジスタr2にロードした後、レジスタr1の値を次のメモリ領域を指すように更新する。   “Ld r2, (r1 +)” loads the contents of the 4-byte memory area indicated by the register r1 into the register r2, and then updates the value of the register r1 to indicate the next memory area.

「St (r0+),r2」は、レジスタr2の値をレジスタr0の指し示すメモリ領域にストアした後、レジスタr0の値を次のメモリ領域を指すように更新する。   “St (r0 +), r2” stores the value of the register r2 in the memory area indicated by the register r0, and then updates the value of the register r0 to indicate the next memory area.

4バイト単位でのロード命令およびストア命令の場合には、アクセスするメモリ領域は4バイトアラインメントされていないと正しく動作しないという制約が存在する。ここで、プラグマ指令のアラインメント情報を利用しない場合には、配列の先頭のアラインメントが不明なため、配列のコピーは1バイトずつ行わなければならず、図13のソースプログラム101は、図14の機械語命令列に翻訳される。この場合、ループの繰り返し回数は256回となる。   In the case of a load instruction and a store instruction in units of 4 bytes, there is a restriction that a memory area to be accessed does not operate correctly unless it is 4-byte aligned. Here, when the alignment information of the pragma command is not used, since the alignment at the head of the array is unknown, the array must be copied byte by byte. The source program 101 in FIG. Translated into word instruction sequence. In this case, the loop is repeated 256 times.

一方、プラグマ指令のアラインメント情報を利用して最適化を行った場合は、配列の先頭のアラインメントが4であることを利用して、配列のコピーは4バイトずつ行うことができる。このため、図13のソースプログラム101は、図15の機械語命令列107aに翻訳される。この場合、ループの繰り返し回数は256/4=64回となり、実行性能が向上する。しかし、プラグマ指令のアラインメント情報が誤っており、配列の先頭がアラインメントの制約を満たしていない場合は、実行結果が不正なものとなる。   On the other hand, when optimization is performed using the alignment information of the pragma command, the array can be copied 4 bytes at a time using the alignment at the beginning of the array being 4. Therefore, the source program 101 in FIG. 13 is translated into the machine language instruction sequence 107a in FIG. In this case, the number of loop iterations is 256/4 = 64, and the execution performance is improved. However, if the alignment information of the pragma command is incorrect and the top of the array does not satisfy the alignment constraint, the execution result is incorrect.

このような場合に、上記プラグマ指令のエラーチェックを行うには、関数の先頭での仮引数aおよびbのアラインメントの情報が分かればよい。関数の先頭の命令をアドレスa151の命令とし、仮引数aおよびbの値の格納されているレジスタをそれぞれレジスタr0、レジスタr1とすると、コンパイル装置102で生成される最適化ヒント情報記述デバッグ情報107bは、図16に示されるようになる。すなわち、関数の先頭で仮引数aおよびbの指すメモリ領域が4バイトアラインメントされていなければならないことが示されている。   In such a case, in order to perform an error check of the pragma command, it is only necessary to know the alignment information of the dummy arguments a and b at the beginning of the function. If the first instruction of the function is the instruction at address a151 and the registers storing the values of the dummy arguments a and b are the register r0 and the register r1, respectively, the optimization hint information description debug information 107b generated by the compiling device 102 is obtained. Is as shown in FIG. That is, it is indicated that the memory area pointed to by the dummy arguments a and b must be 4-byte aligned at the beginning of the function.

デバッグ装置108は、上述の動作例1と同様の処理を行なうが、エラーチェック部113の実行する処理が異なる。   The debug device 108 performs the same processing as in the first operation example described above, but the processing executed by the error check unit 113 is different.

図17は、エラーチェック部113の動作を示すフローチャートである。エラーチェック部113は、エラーチェックポイントにおいて、レジスタの値を取得する(ステップS201)。ここでは、図16に示した最適化ヒント情報記述デバッグ情報107b(112b)に従い、レジスタr0およびレジスタr1の値を取得する。   FIG. 17 is a flowchart showing the operation of the error check unit 113. The error check unit 113 acquires the value of the register at the error check point (step S201). Here, the values of the register r0 and the register r1 are acquired according to the optimization hint information description debug information 107b (112b) shown in FIG.

次に、エラーチェック部113は、取得したレジスタの値が指定したアライメント値の倍数であるか否かを判断する(ステップS202)。ここでは、レジスタr0およびレジスタr1の値が4の倍数であるか否かを判断する。   Next, the error check unit 113 determines whether or not the acquired register value is a multiple of the specified alignment value (step S202). Here, it is determined whether or not the values of the register r0 and the register r1 are multiples of 4.

上述の判断結果が偽の場合には(ステップS202でno)、エラーチェック部113は、エラーメッセージ表示部114を起動し、エラー表示を行なわせる(ステップS203)。   If the determination result is false (no in step S202), the error check unit 113 activates the error message display unit 114 to display an error (step S203).

以上のような処理を行なうことにより、誤ったポインタ型の仮引数の指すメモリ領域のアラインメントを指定するプラグマ指令を検出することができる。
(動作例3)
次に、最適化ヒント情報記述として、繰り返し文の最小繰り返し回数を指定するプラグマ指令がソースプログラム101に含まれている場合のコンパイルシステム100の動作について説明する。
By performing the processing as described above, it is possible to detect a pragma command specifying the alignment of the memory area pointed to by the wrong pointer type dummy argument.
(Operation example 3)
Next, the operation of the compile system 100 when the source program 101 includes a pragma command that specifies the minimum number of repetitions of the repetitive sentence as the optimization hint information description will be described.

図18は、上述のプラグマ指令を含むソースプログラムの一例を示す図である。
ソースプログラム101中のプラグマ指令「#pragma _minimum_times=4」は、forループの繰り返し回数が必ず4以上であることをプログラマがコンパイル装置102に知らせるためのものである。
FIG. 18 is a diagram illustrating an example of a source program including the pragma command described above.
The pragma command “# pragma_minimum_times = 4” in the source program 101 is for the programmer to inform the compiling device 102 that the number of repetitions of the for loop is always 4 or more.

図19にプラグマ指令の情報を利用しないで、翻訳した結果の機械語命令列を示す図である。また、図20にプラグマ指令の情報を利用してコンパイルした結果の機械語命令列107aを示す図である。   FIG. 19 is a diagram illustrating a machine language instruction sequence obtained as a result of translation without using pragma command information. FIG. 20 is a diagram showing a machine language instruction sequence 107a as a result of compiling using information of the pragma instruction.

プラグマ指令の最小繰り返し回数の情報を利用しない場合は、ループ回数が0回および1回の場合も可能性としてある。このため、ループ回数が2回以上の場合に適用可能なソフトウェアパイプライニングによる最適が行えない。よって、図18のソースプログラム101は、図19の機械語命令列に翻訳される。   If the information on the minimum number of repetitions of the pragma command is not used, it is possible that the number of loops is 0 and 1. For this reason, optimization by software pipelining that can be applied when the number of loops is two or more cannot be performed. Therefore, the source program 101 of FIG. 18 is translated into the machine language instruction sequence of FIG.

一方、プラグマ指令の最小繰り返し回数の情報を利用して最適化を行った場合は、ループ回数が2回以上で行えるソフトウェアパイプライニング最適を適用でき、図18のソースプログラム101は、図19の機械語命令列に翻訳される。これによって、実行性能が向上する。しかし、ループ回数が0回または1回の場合には、実行結果が不正となる。   On the other hand, when optimization is performed using information on the minimum number of iterations of the pragma command, software pipelining optimization that can be performed with two or more loops can be applied. The source program 101 in FIG. Translated into word instruction sequence. As a result, execution performance is improved. However, if the number of loops is 0 or 1, the execution result is invalid.

この場合に上記プラグマ指令のエラーチェックを行うには、ループの実行前に、ループの繰り返し回数の最低回数が満たすべき条件の情報が分かればよい。図20の例では、ループの実行前の命令のアドレスがa192で、そのときプラグマ指令が正しいために成立していなければならない条件は、レジスタr0(ソースプログラム101の関数hの仮引数nの値を保持しているレジスタ)の値が、4以上であることである。このため、コンパイル装置102で生成される最適化ヒント情報記述デバッグ情報107bは、図21に示されるようになる。   In this case, in order to perform an error check of the pragma command, it is only necessary to know information on a condition that the minimum number of iterations of the loop should satisfy before executing the loop. In the example of FIG. 20, the address of the instruction before the execution of the loop is a192, and the condition that must be satisfied because the pragma command is correct at this time is the register r0 (value of the formal argument n of the function h of the source program 101) The value of the register holding the) is 4 or more. Therefore, the optimization hint information description debug information 107b generated by the compiling device 102 is as shown in FIG.

すなわち、最適化ヒント情報記述デバッグ情報107bには、エラーチェックポイントのアドレス「a193」と、そのときに成立しなければならない条件(以下、「ループ先頭成立条件」という。)と、プラグマが記述されているソースプログラム101のファイル名と行番号の組である行情報とが含まれる。   That is, the optimization hint information description debug information 107b describes an error checkpoint address “a193”, a condition that must be satisfied at that time (hereinafter referred to as “loop head establishment condition”), and a pragma. Line information that is a set of the file name and line number of the source program 101 being included.

デバッグ装置108は、上述の動作例1と同様の処理を行なうが、エラーチェック部113の実行する処理が異なる。   The debug device 108 performs the same processing as in the first operation example described above, but the processing executed by the error check unit 113 is different.

図22は、エラーチェック部113の動作を示すフローチャートである。エラーチェック部113は、エラーチェックポイントにおいて、レジスタの値を取得する(ステップS301)。ここでは、図21に示される最適化ヒント情報記述デバッグ情報107b(112b)に従い、レジスタr0の値を取得する。   FIG. 22 is a flowchart showing the operation of the error check unit 113. The error check unit 113 acquires the register value at the error check point (step S301). Here, the value of the register r0 is acquired according to the optimization hint information description debug information 107b (112b) shown in FIG.

次に、エラーチェック部113は、取得したレジスタの値がループ先頭成立条件を満たすか否かを判断する(ステップS302)。ここでは、レジスタr0の値が4以上であるか否かを判断する。   Next, the error check unit 113 determines whether or not the acquired register value satisfies a loop head establishment condition (step S302). Here, it is determined whether or not the value of the register r0 is 4 or more.

上述の判断結果が偽の場合には(ステップS302でno)、エラーチェック部113は、エラーメッセージ表示部114を起動し、エラー表示を行なわせる(ステップS303)。   If the determination result is false (no in step S302), the error check unit 113 activates the error message display unit 114 to display an error (step S303).

以上のような処理を行なうことにより、誤った繰り返し文の最小繰り返し回数を指定するプラグマ指令を検出することができる。   By performing the processing as described above, it is possible to detect a pragma command that specifies the minimum number of repetitions of an erroneous repeated sentence.

以上説明したように本発明の実施の形態によると、デバッグ装置が上記最適化ヒント情報記述デバッグ情報を利用してエラーチェックを行うことにより、プログラマがデバッグコードを記述しなくても、最適化ヒント情報が不正か否かを判断することができる。このため、プログラマに高いスキルと大きな工数とを要求することなく、最適化ヒント情報の正当性を判定することができる。   As described above, according to the embodiment of the present invention, the debugging device performs an error check using the optimization hint information description debug information, so that the optimization hint can be obtained even if the programmer does not write debug code. It can be determined whether or not the information is illegal. Therefore, it is possible to determine the validity of the optimization hint information without requiring a high skill and a large man-hour for the programmer.

以上、本発明に係るコンパイルシステムについて、実施の形態に基づいて説明したが、本発明は、この実施の形態に限定されるものではない。   The compiling system according to the present invention has been described above based on the embodiment, but the present invention is not limited to this embodiment.

例えば、最適化ヒント情報の記述がコード最適化部104で最適化に利用されたときにのみ、最適化ヒント情報記述デバッグ情報生成部106が、最適化ヒント情報の記述に対する最適化ヒント情報記述デバッグ情報107bを生成するようにしてもよい。これにより、最適化ヒント情報記述デバッグ情報107bのサイズを削減することができ、デバッグ装置108でエラーチェックに要する時間も短縮できる。   For example, only when the description of the optimization hint information is used for optimization by the code optimization unit 104, the optimization hint information description debug information generation unit 106 debugs the optimization hint information description for the description of the optimization hint information. The information 107b may be generated. Thereby, the size of the optimization hint information description debug information 107b can be reduced, and the time required for the error check by the debug device 108 can also be shortened.

また、コンパイル装置102は、最適化ヒント情報の記述がコード最適化部104で最適化に利用されたか否かを表示する表示部を備えてもよい。これにより、プログラマは、コンパイル装置212で利用されていない最適化ヒント情報の記述を認識でき、利用されない部分の最適化ヒント情報記述に関するテストを省略することができる。よって、プログラム開発効率を向上させることが可能となる。   In addition, the compiling device 102 may include a display unit that displays whether or not the description of the optimization hint information is used for optimization by the code optimization unit 104. Thereby, the programmer can recognize the description of the optimization hint information that is not used by the compiling device 212, and can omit the test related to the description of the optimization hint information that is not used. Therefore, it is possible to improve program development efficiency.

また、デバッグ装置108は、さらに、エラーチェック部113によるエラーチェック機能を有効または無効にする切り替え部を備えるようにしてもよい。この場合、エラーチェックが不要のときは、エラーチェック機能を無効にできるため、プログラムのデバッグ効率が向上する。   Further, the debug device 108 may further include a switching unit that enables or disables the error check function by the error check unit 113. In this case, when the error check is unnecessary, the error check function can be disabled, so that the debugging efficiency of the program is improved.

また、デバッグ装置108は、さらに、ユーザからの機械語プログラム107のファイル名の指定を受け付けるファイル名受け付け部を備え、エラーチェック部113は、指定されたファイル名の機械語プログラム107に対してのみエラーチェックを行うようにしてもよい。このような処理を行なうことにより、特定のソースプログラム101の最適化ヒント情報の記述のみを変更した場合に、そのソースプログラム101に対応する機械語プログラム107だけをエラーチェックすることができ、デバッグ効率が向上する。   Further, the debugging device 108 further includes a file name receiving unit that receives the designation of the file name of the machine language program 107 from the user, and the error check unit 113 is only for the machine language program 107 having the designated file name. An error check may be performed. By performing such processing, when only the description of the optimization hint information of a specific source program 101 is changed, only the machine language program 107 corresponding to the source program 101 can be checked for errors, and debugging efficiency can be improved. Will improve.

また、デバッグ装置108は、ソースプログラム101中の関数を指定する関数指定部を備え、エラーチェック部113は、指定された関数の定義に含まれる最適化ヒント情報の記述に対してのみエラーチェックを行うようにしてもよい。こうすることにより、特定の関数の最適化ヒント情報の記述のみを変更した場合に、その関数だけをエラーチェックすることができ、デバッグ効率が向上する。   Further, the debugging device 108 includes a function designating unit that designates a function in the source program 101, and the error check unit 113 performs an error check only for the description of the optimization hint information included in the definition of the designated function. You may make it perform. In this way, when only the description of the optimization hint information of a specific function is changed, only that function can be checked for errors, improving debugging efficiency.

また、本実施の形態に係るデバッグ装置108では、最適化ヒント情報のエラー判定を行う構成としているが、エラー判定をデバッグ装置108では行わず、デバッグ装置は、エラー判定に必要な実行時情報の収集のみを行い、その情報を出力するようにしてもよい。その場合には、エラー判定は別の装置で行なわれる。   In addition, the debugging device 108 according to the present embodiment is configured to perform error determination of optimization hint information. However, the debugging device 108 does not perform error determination, and the debugging device stores runtime information necessary for error determination. Only the collection may be performed and the information may be output. In that case, the error determination is performed by another device.

また、最適化ヒント情報の他の例としては、ループの回数が偶数回数または奇数回数であることを指定するプラグマもある。このプラグマは、ループアンローリングの指定の際に用いられる
また、実施の形態におけるコンパイル装置およびデバッグ装置を機械語プログラムにより実現し、これを記憶媒体に記憶して流通・販売の対象にしてもよい。このような記憶媒体には、ICカード、光ディスクフレキシブルディスク、ROM等があるが、これらに記憶された機械語プログラムは、汎用のコンピュータにインストールされることにより利用に供される。即ち、汎用のコンピュータは、インストールした上記機械語プログラムを逐次実行して、実施の形態に示したようなコンパイル装置およびデバッグ装置を実現する。また、汎用のコンピュータに上述のコンパイル装置およびデバッグ装置を実行させるためのコンピュータプログラムは、ハードディスク等の記憶媒体および通信回線等を介してオンラインで流通させ頒布することもできる。
Another example of the optimization hint information is a pragma that specifies that the number of loops is an even number or an odd number. This pragma is used when designating loop unrolling. Also, the compiling device and the debugging device in the embodiment may be realized by a machine language program, and this may be stored in a storage medium to be distributed and sold. . Such a storage medium includes an IC card, an optical disk flexible disk, a ROM, and the like. The machine language program stored in these storage media is used by being installed in a general-purpose computer. That is, the general-purpose computer sequentially executes the installed machine language program to realize the compiling device and the debugging device as shown in the embodiment. A computer program for causing a general-purpose computer to execute the above-described compiling device and debugging device can be distributed and distributed online via a storage medium such as a hard disk and a communication line.

本発明に係るコンパイル装置およびデバッグ装置によると、ソースプログラムの最適化ヒント情報記述のエラーチェックが可能となるので、ソフトウェア開発環境等として有用である。   According to the compiling device and the debugging device according to the present invention, it is possible to perform an error check of the optimization hint information description of the source program, which is useful as a software development environment.

本発明の実施の形態に係るコンパイルシステムの構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the compilation system which concerns on embodiment of this invention. restrict記述を含むソースプログラムの一例を示す図である。It is a figure which shows an example of the source program containing a restriction description. restrict記述の情報を利用しないで、ソースプログラムを翻訳した結果の機械語命令列を示す図である。It is a figure which shows the machine language command sequence as a result of having translated the source program, without using the information of restrict description. restrict記述の情報を利用して、ソースプログラムをコンパイルした結果の機械語命令列を示す図である。It is a figure which shows the machine language instruction sequence as a result of compiling a source program using the information of restrict description. 最適化ヒント情報記述検出部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the optimization hint information description detection part. エラーチェックポイント検出部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of an error checkpoint detection part. 図2のソースプログラムのrestrict記述に対する最適化ヒント情報記述デバッグ情報の一例を示す図である。It is a figure which shows an example of the optimization hint information description debug information with respect to the restrict description of the source program of FIG. デバッグ装置でエラーチェックが行える形式の最適化ヒント情報記述デバッグ情報の一例を示す図である。It is a figure which shows an example of the optimization hint information description debug information of the format which can perform an error check with a debugging apparatus. 実行エンジンによる機械語命令列実行時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of machine language instruction sequence execution by an execution engine. エラーチェック部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of an error check part. 図4に示す機械語命令列のアドレスa402でのエラーチェック後の最適化ヒント情報記述デバッグ情報の一例を示す図である。FIG. 5 is a diagram showing an example of optimization hint information description debug information after an error check at an address a402 of the machine language instruction sequence shown in FIG. 4. 図4に示す機械語命令列のアドレスa406でのエラーチェック後の最適化ヒント情報記述デバッグ情報の一例を示す図である。FIG. 5 is a diagram illustrating an example of optimization hint information description debug information after an error check at an address a406 of the machine language instruction sequence illustrated in FIG. 4. ポインタ型の仮引数の指すメモリ領域のアラインメントを指定するプラグマ指令を含むソースプログラムの一例を示す図である。It is a figure which shows an example of the source program containing the pragma command which designates the alignment of the memory area which a pointer type dummy argument points to. プラグマ指令の情報を利用しないで図13に示すソースプログラムを翻訳した結果の機械語命令列を示す図である。FIG. 14 is a diagram showing a machine language instruction sequence as a result of translating the source program shown in FIG. 13 without using information of a pragma instruction. プラグマ指令の情報を利用して図13に示すソースプログラムを翻訳した結果の機械語命令列を示す図である。FIG. 14 is a diagram illustrating a machine language instruction sequence as a result of translating the source program illustrated in FIG. 13 using pragma instruction information. 図15の機械語命令列に対する、最適化ヒント情報記述デバッグ情報の一例を示す図である。It is a figure which shows an example of the optimization hint information description debug information with respect to the machine language instruction sequence of FIG. エラーチェック部の動作を示す他のフローチャートである。It is another flowchart which shows operation | movement of an error check part. 繰り返し文の最小繰り返し回数を指定するプラグマ指令を含むソースプログラムの一例を示す図である。It is a figure which shows an example of the source program containing the pragma command which designates the minimum repetition frequency | count of a repetition sentence. プラグマ指令の情報を利用しないで図18に示すソースプログラムを翻訳した結果の機械語命令列を示す図である。FIG. 19 is a diagram illustrating a machine language instruction sequence obtained as a result of translating the source program illustrated in FIG. 18 without using pragma instruction information. プラグマ指令の情報を利用して図18に示すソースプログラムを翻訳した結果の機械語命令列を示す図である。FIG. 19 is a diagram illustrating a machine language instruction sequence obtained as a result of translating the source program shown in FIG. 18 using information of a pragma instruction. 図20の機械語命令列に対する、最適化ヒント情報記述デバッグ情報の一例を示す図である。It is a figure which shows an example of the optimization hint information description debug information with respect to the machine language instruction sequence of FIG. エラーチェック部の動作を示すさらに他のフローチャートである。It is another flowchart which shows operation | movement of an error check part.

符号の説明Explanation of symbols

100 コンパイルシステム
101 ソースプログラム
102 コンパイル装置
103 最適化ヒント情報記述検出部
104 コード最適化部
105 エラーチェックポイント検出部
106 最適化ヒント情報記述デバッグ情報生成部
107 機械語プログラム
107a 機械語命令列
107b,112b 最適化ヒント情報記述デバッグ情報
108 デバッグ装置
109 入力部
110 実行エンジン
111 機械語命令列記憶部
112 デバッグ情報記憶部
113 エラーチェック部
114 エラーメッセージ表示部

DESCRIPTION OF SYMBOLS 100 Compile system 101 Source program 102 Compile apparatus 103 Optimization hint information description detection part 104 Code optimization part 105 Error checkpoint detection part 106 Optimization hint information description debug information generation part 107 Machine language program 107a Machine language instruction sequence 107b, 112b Optimization hint information description debug information 108 Debugging device 109 Input unit 110 Execution engine 111 Machine language instruction sequence storage unit 112 Debug information storage unit 113 Error check unit 114 Error message display unit

Claims (24)

高級言語で記述されたソースプログラムを機械語命令列に翻訳するコンパイル装置であって、
機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて、ソースプログラムを最適化された機械語命令列に翻訳する翻訳手段と、
前記指示を、ソースプログラム中より検出する指示検出手段と、
検出された前記指示に基づいて、当該指示が不正か否かを判断可能な前記機械語命令列上の位置を検出する位置検出手段と、
前記指示の前記ソースプログラム中での記述位置と、前記位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を生成するデバッグ情報生成手段と
を備えることを特徴とするコンパイル装置。
A compiling device that translates a source program written in a high-level language into a machine language instruction sequence,
A translation means for translating a source program into an optimized machine language instruction sequence based on an instruction to a compiling device for optimizing the machine language instruction sequence;
Instruction detecting means for detecting the instruction from a source program;
Based on the detected instruction, position detecting means for detecting a position on the machine language instruction sequence capable of determining whether the instruction is illegal;
Debug information generating means for generating debug information including a description position of the instruction in the source program, the position, and information necessary for determining whether the instruction is invalid or not. Compile device.
前記指示は、C99言語(ISO(International Organization for Standardization)/IEC(International Electrotechnical Commission) 9899:1999 Programming language C)のrestrict記述であり、
前記位置検出手段は、前記restrict記述により指定されたポインタ変数を介してメモリアクセスする命令の位置を検出し、
前記指示が不正か否かを判断するために必要な情報は、前記変数と前記命令とを対応づける情報である
ことを特徴とする請求項1に記載のコンパイル装置。
The instruction is a restrictive description in C99 language (ISO (International Organization for Standardization) / IEC (International Electrotechnical Commission) 9899: 1999 Programming language C),
The position detecting means detects a position of an instruction to access a memory via a pointer variable designated by the restrict description,
The compiling apparatus according to claim 1, wherein the information necessary for determining whether or not the instruction is illegal is information that associates the variable with the instruction.
前記指示は、関数におけるポインタ型の仮引数の指すメモリ領域のアラインメント値を指定するプラグマ指令であり、
前記位置検出手段は、前記プラグマ指令で修飾された関数の先頭の命令の位置を検出し、
前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定されたアラインメント値である
ことを特徴とする請求項1に記載のコンパイル装置。
The instruction is a pragma instruction that specifies an alignment value of a memory area pointed to by a pointer type dummy argument in a function,
The position detection means detects the position of the first instruction of the function modified by the pragma instruction,
The compiling apparatus according to claim 1, wherein the information necessary for determining whether or not the instruction is illegal is an alignment value specified by the pragma instruction.
前記指示は、ループのイタレーション回数を指定するプラグマ指令であり、
前記位置検出手段は、前記プラグマ指令で修飾されたループの直前の命令の位置を検出し、
前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定される前記ループの直前で満たされるべき条件である
ことを特徴とする請求項1に記載のコンパイル装置。
The instruction is a pragma command that specifies the number of iterations of the loop,
The position detection means detects the position of the instruction immediately before the loop modified with the pragma instruction,
The compiling apparatus according to claim 1, wherein the information necessary for determining whether or not the instruction is invalid is a condition that should be satisfied immediately before the loop specified by the pragma instruction.
前記デバッグ情報生成手段は、最適化で利用された前記指示に対するデバッグ情報のみを生成する
ことを特徴とする請求項1に記載のコンパイル装置。
The compiling apparatus according to claim 1, wherein the debug information generation unit generates only debug information for the instruction used in optimization.
さらに、前記指示が最適化で利用されたか否かを表示する表示手段を備える
ことを特徴とする請求項1に記載のコンパイル装置。
The compiling apparatus according to claim 1, further comprising display means for displaying whether or not the instruction is used in optimization.
高級言語で記述されたソースプログラムを、機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて翻訳した結果である機械語命令列を実行しながら当該機械語命令列の誤りを検出するデバッグ装置であって、
機械語命令列を読み込む機械語命令列読み込み手段と、
前記指示の前記ソースプログラム中での記述位置と、当該指示が不正か否かを判断可能な前記機械語命令列上の位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を読み込むデバッグ情報読み込み手段と、
前記機械語命令列読み込み手段で読み込まれた前記機械語命令列を実行する実行手段と、
前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する判断手段と
を備えることを特徴とするデバッグ装置。
An error in the machine language instruction sequence is detected while executing a machine language instruction sequence that is a result of translating a source program described in a high-level language based on an instruction to a compiling device for optimizing the machine language instruction sequence. A debugging device,
A machine language instruction sequence reading means for reading a machine language instruction sequence;
A description position in the source program of the instruction, a position on the machine language instruction sequence from which it can be determined whether or not the instruction is illegal, and information necessary to determine whether or not the instruction is illegal Debug information reading means for reading debug information including
Executing means for executing the machine language instruction sequence read by the machine language instruction sequence reading means;
Determination means for determining whether or not the instruction is illegal when executing a machine language instruction at a position on the machine language instruction sequence where it can be determined whether or not the instruction is illegal based on the debug information. Debugging device characterized by
前記指示は、C99言語のrestrict記述であり、
前記判断手段は、
前記デバッグ情報に基づいて、前記restrict記述により指定されたポインタ変数を介してメモリアクセスする命令の実行時に、前記restrict記述により指定されるポインタ変数を介してアクセスされるメモリ領域が、他のポインタ変数を介してアクセスされるメモリ領域と重なるか否かを判断する重なり判断部と、
前記重なり判断部でメモリ領域同士が重なりを有すると判断された場合には、前記restrict記述が不正であると判断する不正判断部とを有する
ことを特徴とする請求項7に記載のデバッグ装置。
The instruction is a restrictive description in C99 language,
The determination means includes
Based on the debug information, the memory area accessed via the pointer variable specified by the restrict description at the time of executing an instruction that accesses the memory via the pointer variable specified by the restrict description is changed to another pointer variable. An overlap determination unit that determines whether or not it overlaps a memory area accessed via
The debugging apparatus according to claim 7, further comprising: an fraud determination unit that determines that the restriction description is invalid when the overlap determination unit determines that the memory areas have an overlap.
前記指示は、関数におけるポインタ型の仮引数の指すメモリ領域のアラインメント値を指定するプラグマ指令であり、
前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定されたアラインメント値であり、
前記判断手段は、
前記デバッグ情報に基づいて、前記プラグマ指令で修飾された関数の先頭の命令の実行時に、前記仮引数の指すメモリ領域のアライメント値が前記プラグマ指令で指定されたアライメント値の倍数であるか否かを判断する倍数判断部と、
前記倍数判断部で前記仮引数の指すメモリ領域のアライメント値が前記プラグマ指令で指定されたアライメント値の倍数でないと判断された場合には、前記プラグマ指令が不正であると判断する不正判断部とを有する
ことを特徴とする請求項7に記載のデバッグ装置。
The instruction is a pragma instruction that specifies an alignment value of a memory area pointed to by a pointer type dummy argument in a function,
The information necessary to determine whether the instruction is invalid is an alignment value specified by the pragma instruction,
The determination means includes
Whether or not the alignment value of the memory area pointed to by the formal argument is a multiple of the alignment value specified by the pragma command when executing the first instruction of the function qualified by the pragma command based on the debug information A multiple determination unit for determining
An illegal determination unit that determines that the pragma command is invalid when the multiple determination unit determines that the alignment value of the memory area pointed to by the dummy argument is not a multiple of the alignment value specified by the pragma command; The debugging device according to claim 7, comprising:
前記指示は、ループのイタレーション回数を指定するプラグマ指令であり、
前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定される前記ループの直前で満たされるべき条件であり、
前記判断手段は、
前記デバッグ情報に基づいて、前記プラグマ指令で修飾されたループの直前の命令の実行時に、前記ループのイタレーション回数が前記ループの直前で満たされるべき条件を満たしているか否かを判断する条件判断部と、
前記条件判断部で前記条件を満たしていないと判断された場合には、前記プラグマ指令が不正であると判断する不正判断部とを有する
ことを特徴とする請求項7に記載のデバッグ装置。
The instruction is a pragma command that specifies the number of iterations of the loop,
Information necessary to determine whether the instruction is invalid is a condition that should be satisfied immediately before the loop specified by the pragma instruction,
The determination means includes
Condition determination for determining whether or not the number of iterations of the loop satisfies a condition that should be satisfied immediately before the loop when executing an instruction immediately before the loop qualified by the pragma instruction based on the debug information And
The debugging apparatus according to claim 7, further comprising: a fraud determination unit that determines that the pragma command is invalid when the condition determination unit determines that the condition is not satisfied.
さらに、前記判断手段で前記指示が不正であると判断された場合には、前記指示の前記ソースプログラム中での記述位置を含むエラーメッセージを出力するエラーメッセージ出力手段を備える
ことを特徴とする請求項7〜10のいずれか1項に記載のデバッグ装置。
And an error message output unit configured to output an error message including a description position of the instruction in the source program when the determination unit determines that the instruction is invalid. Item 11. The debugging device according to any one of Items 7 to 10.
さらに、前記判断手段による判断処理を行なうかまたは行なわないかを切り替えるための切り替え手段を備える
ことを特徴とする請求項7〜11のいずれか1項に記載のデバッグ装置。
The debugging device according to any one of claims 7 to 11, further comprising switching means for switching whether or not to perform determination processing by the determination means.
さらに、前記機械語命令列読み込み手段が読み込む機械語命令列に対応するソースプログラムと、前記デバッグ情報読み込み手段が読み込むデバッグ情報との指定を受け付ける受け付け手段を備え、
前記デバッグ情報読み込み手段は、前記受け付け手段で指定されたデバッグ情報を読み込み、
前記判断手段は、前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記ソースプログラムに対応する前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する
ことを特徴とする請求項7〜12のいずれか1項に記載のデバッグ装置。
Further, the machine language instruction sequence reading means includes a source program corresponding to the machine language instruction sequence read by the machine language instruction sequence reading means, and a receiving means for receiving designation of debug information read by the debug information reading means,
The debug information reading means reads the debug information designated by the accepting means,
The determination means determines whether the instruction is illegal when executing a machine language instruction at a position on the machine language instruction sequence corresponding to the source program capable of determining whether the instruction is illegal based on the debug information. The debugging device according to any one of claims 7 to 12, wherein it is determined whether or not.
さらに、前記ソースプログラム中の関数の指定を受け付ける関数指定受け付け手段を備え、
前記判断手段は、前記デバッグ情報に基づいて、前記関数指定受け付け手段で指定された関数のみに対して、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する
ことを特徴とする請求項7〜12のいずれか1項に記載のデバッグ装置
Furthermore, a function designation receiving means for receiving a function designation in the source program is provided,
The determination means is a machine language instruction at a position on the machine language instruction sequence that can determine whether or not the instruction is invalid only for the function designated by the function designation reception means based on the debug information. The debugging device according to any one of claims 7 to 12, wherein whether or not the instruction is illegal is determined when the command is executed.
高級言語で記述されたソースプログラムを、機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて翻訳した結果である機械語命令列を実行しながら当該機械語命令列の誤りを検出するデバッグ装置であって、
機械語命令列を読み込む機械語命令列読み込み手段と、
前記指示の前記ソースプログラム中での記述位置と、当該指示が不正か否かを判断可能な前記機械語命令列上の位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を読み込むデバッグ情報読み込み手段と、
前記機械語命令列読み込み手段で読み込まれた前記機械語命令列を実行する実行手段と、
前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断するための情報を前記機械語命令の実行結果より収集する収集手段と
を備えることを特徴とするデバッグ装置。
An error in the machine language instruction sequence is detected while executing a machine language instruction sequence that is a result of translating a source program described in a high-level language based on an instruction to a compiling device for optimizing the machine language instruction sequence. A debugging device,
A machine language instruction sequence reading means for reading a machine language instruction sequence;
A description position in the source program of the instruction, a position on the machine language instruction sequence from which it can be determined whether or not the instruction is illegal, and information necessary to determine whether or not the instruction is illegal Debug information reading means for reading debug information including
Executing means for executing the machine language instruction sequence read by the machine language instruction sequence reading means;
Based on the debug information, when executing a machine language instruction at a position on the machine language instruction sequence where it is possible to determine whether the instruction is invalid, information for determining whether the instruction is illegal is used as the machine. A debugging device comprising: a collecting means for collecting from the execution result of the word instruction.
高級言語で記述されたソースプログラムを機械語命令列に翻訳するコンパイルシステムであって、
高級言語で記述されたソースプログラムを機械語命令列に翻訳し、かつ機械語命令列の最適化のためのコンパイル装置に対する指示の正当性を判断するためのデバッグ情報を生成するコンパイル装置と、
前記機械語命令列および前記デバッグ情報に基づいて、前記指示の誤りを検出するデバッグ装置とを備え、
前記コンパイル装置は、
機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて、ソースプログラムを最適化された機械語命令列に翻訳する翻訳手段と、
前記指示を、ソースプログラム中より検出する指示検出手段と、
検出された前記指示に基づいて、当該指示が不正か否かを判断可能な前記機械語命令列上の位置を検出する位置検出手段と、
前記指示の前記ソースプログラム中での記述位置と、前記位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を生成するデバッグ情報生成手段とを有し、
前記デバッグ装置は、
前記機械語命令列を読み込む機械語命令列読み込み手段と、
前記指示の前記ソースプログラム中での記述位置と、当該指示が不正か否かを判断可能な前記機械語命令列上の位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を読み込むデバッグ情報読み込み手段と、
前記機械語命令列読み込み手段で読み込まれた前記機械語命令列を実行する実行手段と、
前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する判断手段とを有する
ことを特徴とするコンパイルシステム。
A compilation system that translates a source program written in a high-level language into a machine language instruction sequence,
A compiling device that translates a source program described in a high-level language into a machine language instruction sequence and generates debug information for judging the validity of instructions to the compiling device for optimizing the machine language instruction sequence;
A debugging device that detects an error in the instruction based on the machine language instruction sequence and the debug information;
The compiling device is:
A translation means for translating a source program into an optimized machine language instruction sequence based on an instruction to a compiling device for optimizing the machine language instruction sequence;
Instruction detecting means for detecting the instruction from a source program;
Based on the detected instruction, position detecting means for detecting a position on the machine language instruction sequence capable of determining whether the instruction is illegal;
Debug information generating means for generating debug information including a description position of the instruction in the source program, the position, and information necessary for determining whether the instruction is invalid;
The debugging device includes:
A machine language instruction sequence reading means for reading the machine language instruction sequence;
A description position in the source program of the instruction, a position on the machine language instruction sequence from which it can be determined whether or not the instruction is illegal, and information necessary to determine whether or not the instruction is illegal Debug information reading means for reading debug information including
Executing means for executing the machine language instruction sequence read by the machine language instruction sequence reading means;
Determination means for determining whether or not the instruction is illegal when executing a machine language instruction at a position on the machine language instruction sequence where it can be determined whether or not the instruction is illegal based on the debug information. Compile system characterized by
前記指示は、C99言語のrestrict記述であり、
前記指示が不正か否かを判断するために必要な情報は、前記変数と前記命令とを対応づける情報であり、
前記位置検出手段は、前記restrict記述により指定されたポインタ変数を介してメモリアクセスする命令の位置を検出し、
前記判断手段は、
前記デバッグ情報に基づいて、前記restrict記述により指定されたポインタ変数を介してメモリアクセスする命令の実行時に、前記restrict記述により指定されるポインタ変数を介してアクセスされるメモリ領域が、他のポインタ変数を介してアクセスされるメモリ領域と重なるか否かを判断する重なり判断部と、
前記重なり判断部でメモリ領域同士が重なりを有すると判断された場合には、前記restrict記述が不正であると判断する不正判断部とを有する
ことを特徴とする請求項16に記載のコンパイルシステム。
The instruction is a restrictive description in C99 language,
Information necessary to determine whether the instruction is illegal is information that associates the variable with the command,
The position detecting means detects a position of an instruction to access a memory via a pointer variable designated by the restrict description,
The determination means includes
Based on the debug information, the memory area accessed via the pointer variable specified by the restrict description at the time of executing an instruction that accesses the memory via the pointer variable specified by the restrict description is changed to another pointer variable. An overlap determination unit that determines whether or not it overlaps a memory area accessed via
The compiling system according to claim 16, further comprising an fraud determination unit that determines that the restrictive description is invalid when the overlap determination unit determines that the memory areas have an overlap.
前記指示は、関数におけるポインタ型の仮引数の指すメモリ領域のアラインメント値を指定するプラグマ指令であり、
前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定されたアラインメント値であり、
前記位置検出手段は、前記プラグマ指令で修飾された関数の先頭の命令の位置を検出し、
前記判断手段は、
前記デバッグ情報に基づいて、前記プラグマ指令で修飾された関数の先頭の命令の実行時に、前記仮引数の指すメモリ領域のアライメント値が前記プラグマ指令で指定されたアライメント値の倍数であるか否かを判断する倍数判断部と、
前記倍数判断部で前記仮引数の指すメモリ領域のアライメント値が前記プラグマ指令で指定されたアライメント値の倍数でないと判断された場合には、前記プラグマ指令が不正であると判断する不正判断部とを有する
ことを特徴とする請求項16に記載のコンパイルシステム。
The instruction is a pragma instruction that specifies an alignment value of a memory area pointed to by a pointer type dummy argument in a function,
The information necessary to determine whether the instruction is invalid is an alignment value specified by the pragma instruction,
The position detection means detects the position of the first instruction of the function modified by the pragma instruction,
The determination means includes
Whether or not the alignment value of the memory area pointed to by the formal argument is a multiple of the alignment value specified by the pragma command when executing the first instruction of the function qualified by the pragma command based on the debug information A multiple determination unit for determining
An illegal determination unit that determines that the pragma command is invalid when the multiple determination unit determines that the alignment value of the memory area pointed to by the dummy argument is not a multiple of the alignment value specified by the pragma command; The compiling system according to claim 16, comprising:
前記指示は、ループのイタレーション回数を指定するプラグマ指令であり、
前記指示が不正か否かを判断するために必要な情報は、前記プラグマ指令で指定される前記ループの直前で満たされるべき条件であり、
前記位置検出手段は、前記プラグマ指令で修飾されたループの直前の命令の位置を検出し、
前記判断手段は、
前記デバッグ情報に基づいて、前記プラグマ指令で修飾されたループの直前の命令の実行時に、前記ループのイタレーション回数が前記ループの直前で満たされるべき条件を満たしているか否かを判断する条件判断部と、
前記条件判断部で前記条件を満たしていないと判断された場合には、前記プラグマ指令が不正であると判断する不正判断部とを有する
ことを特徴とする請求項16に記載のコンパイルシステム。
The instruction is a pragma command that specifies the number of iterations of the loop,
Information necessary to determine whether the instruction is invalid is a condition that should be satisfied immediately before the loop specified by the pragma instruction,
The position detection means detects the position of the instruction immediately before the loop modified with the pragma instruction,
The determination means includes
Condition determination for determining whether or not the number of iterations of the loop satisfies a condition that should be satisfied immediately before the loop when executing an instruction immediately before the loop qualified by the pragma instruction based on the debug information And
The compiling system according to claim 16, further comprising an fraud determination unit that determines that the pragma instruction is invalid when the condition determination unit determines that the condition is not satisfied.
高級言語で記述されたソースプログラムを機械語命令列に翻訳するコンパイル方法であって、
機械語命令列の最適化のためのコンパイル方法に対する指示に基づいて、ソースプログラムを最適化された機械語命令列に翻訳する翻訳ステップと、
前記指示を、ソースプログラム中より検出する指示検出ステップと、
検出された前記指示に基づいて、当該指示が不正か否かを判断可能な前記機械語命令列上の位置を検出する位置検出ステップと、
前記指示の前記ソースプログラム中での記述位置と、前記位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を生成するデバッグ情報生成ステップと
を含むことを特徴とするコンパイル方法。
A compiling method for translating a source program written in a high-level language into a machine language instruction sequence,
A translation step for translating the source program into an optimized machine language instruction sequence based on instructions to a compilation method for optimizing the machine language instruction sequence;
An instruction detecting step for detecting the instruction from a source program;
A position detecting step for detecting a position on the machine language instruction sequence that can determine whether the instruction is illegal based on the detected instruction;
A debug information generating step for generating debug information including a description position of the instruction in the source program, the position, and information necessary for determining whether the instruction is invalid or not. Compile method.
高級言語で記述されたソースプログラムを、機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて翻訳した結果である機械語命令列を実行しながら当該機械語命令列の誤りを検出するデバッグ方法であって、
機械語命令列を読み込む機械語命令列読み込みステップと、
前記指示の前記ソースプログラム中での記述位置と、当該指示が不正か否かを判断可能な前記機械語命令列上の位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を読み込むデバッグ情報読み込みステップと、
前記機械語命令列読み込み手段で読み込まれた前記機械語命令列を実行する実行ステップと、
前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する判断ステップと
を含むことを特徴とするデバッグ方法。
An error in the machine language instruction sequence is detected while executing a machine language instruction sequence that is a result of translating a source program described in a high-level language based on an instruction to a compiling device for optimizing the machine language instruction sequence. A debugging method,
A machine language instruction sequence reading step for reading a machine language instruction sequence;
A description position in the source program of the instruction, a position on the machine language instruction sequence from which it can be determined whether or not the instruction is illegal, and information necessary to determine whether or not the instruction is illegal A debugging information loading step for loading debugging information including
An execution step of executing the machine language instruction sequence read by the machine language instruction sequence reading means;
A determination step of determining whether or not the instruction is illegal when executing a machine language instruction at a position on the machine language instruction sequence where it is possible to determine whether or not the instruction is illegal based on the debug information. A debugging method characterized by the above.
高級言語で記述されたソースプログラムを機械語命令列に翻訳するコンパイラであって、
機械語命令列の最適化のためのコンパイラに対する指示に基づいて、ソースプログラムを最適化された機械語命令列に翻訳する翻訳ステップと、
前記指示を、ソースプログラム中より検出する指示検出ステップと、
検出された前記指示に基づいて、当該指示が不正か否かを判断可能な前記機械語命令列上の位置を検出する位置検出ステップと、
前記指示の前記ソースプログラム中での記述位置と、前記位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を生成するデバッグ情報生成ステップと
をコンピュータに実行させることを特徴とするコンパイラ。
A compiler that translates a source program written in a high-level language into a machine language instruction sequence,
A translation step for translating the source program into an optimized machine language instruction sequence based on instructions to the compiler for optimizing the machine language instruction sequence;
An instruction detecting step for detecting the instruction from a source program;
A position detecting step for detecting a position on the machine language instruction sequence that can determine whether the instruction is illegal based on the detected instruction;
Causing a computer to execute a debug information generation step of generating debug information including a description position of the instruction in the source program, the position, and information necessary to determine whether the instruction is invalid or not. A compiler characterized by that.
高級言語で記述されたソースプログラムを、機械語命令列の最適化のためのコンパイル装置に対する指示に基づいて翻訳した結果である機械語命令列を実行しながら当該機械語命令列の誤りを検出するデバッガであって、
機械語命令列を読み込む機械語命令列読み込みステップと、
前記指示の前記ソースプログラム中での記述位置と、当該指示が不正か否かを判断可能な前記機械語命令列上の位置と、前記指示が不正か否かを判断するために必要な情報とを含むデバッグ情報を読み込むデバッグ情報読み込みステップと、
前記機械語命令列読み込み手段で読み込まれた前記機械語命令列を実行する実行ステップと、
前記デバッグ情報に基づいて、前記指示が不正か否かを判断可能な前記機械語命令列上の位置における機械語命令の実行時に、前記指示が不正か否かを判断する判断ステップと
をコンピュータに実行させることを特徴とするデバッガ。
An error in the machine language instruction sequence is detected while executing a machine language instruction sequence that is a result of translating a source program described in a high-level language based on an instruction to a compiling device for optimizing the machine language instruction sequence. A debugger,
A machine language instruction sequence reading step for reading a machine language instruction sequence;
A description position in the source program of the instruction, a position on the machine language instruction sequence from which it can be determined whether or not the instruction is illegal, and information necessary to determine whether or not the instruction is illegal A debugging information loading step for loading debugging information including
An execution step of executing the machine language instruction sequence read by the machine language instruction sequence reading means;
A determination step of determining whether or not the instruction is illegal when executing a machine language instruction at a position on the machine language instruction sequence where it is possible to determine whether or not the instruction is illegal based on the debug information; A debugger characterized by being executed.
コンピュータ読み取り可能な記録媒体であって、
請求項22に記載のコンパイラまたは請求項23に記載のデバッガを記録した
ことを特徴とするコンピュータ読み取り可能な記録媒体。

A computer-readable recording medium,
A computer-readable recording medium, wherein the compiler according to claim 22 or the debugger according to claim 23 is recorded.

JP2004347302A 2004-11-30 2004-11-30 Compiling device and debugging device Withdrawn JP2006155386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004347302A JP2006155386A (en) 2004-11-30 2004-11-30 Compiling device and debugging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004347302A JP2006155386A (en) 2004-11-30 2004-11-30 Compiling device and debugging device

Publications (1)

Publication Number Publication Date
JP2006155386A true JP2006155386A (en) 2006-06-15

Family

ID=36633587

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004347302A Withdrawn JP2006155386A (en) 2004-11-30 2004-11-30 Compiling device and debugging device

Country Status (1)

Country Link
JP (1) JP2006155386A (en)

Cited By (2)

* 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
JP2016177652A (en) * 2015-03-20 2016-10-06 富士通株式会社 Complier program, system, method, and device

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
JP2010108258A (en) * 2008-10-30 2010-05-13 Panasonic Corp Compiling method and compiling program
JP2016177652A (en) * 2015-03-20 2016-10-06 富士通株式会社 Complier program, system, method, and device

Similar Documents

Publication Publication Date Title
Verdoolaege et al. Equivalence checking of static affine programs using widening to handle recurrences
CN102360334B (en) Dynamic and static combined software security test method
US5854924A (en) Static debugging tool and method
JP5821651B2 (en) Method and system for verifying C ++ programs using symbolic execution
JP5803690B2 (en) Software architecture for verifying C ++ programs using symbolic execution
US5903749A (en) Method and apparatus for implementing check instructions that allow for the reuse of memory conflict information if no memory conflict occurs
Blasi et al. MeMo: Automatically identifying metamorphic relations in Javadoc comments for test automation
Amme et al. Data dependence analysis of assembly code
CN100468337C (en) Program processing apparatus
JP6164054B2 (en) Information processing apparatus, compiling method, and compiler program
Di Federico et al. A jump-target identification method for multi-architecture static binary translation
Lim et al. Automatic equivalence checking for assembly implementations of cryptography libraries
Selfridge GRIFT: A richly-typed, deeply-embedded RISC-V semantics written in Haskell
Grent et al. Automatically identifying parameter constraints in complex web APIs: A case study at adyen
JP2006155386A (en) Compiling device and debugging device
Straznickas Towards a verified first-stage bootloader in Coq
Hubbers et al. From finite state machines to provably correct java card applets
JPH06309193A (en) Method and device for verifying operation of machine language program
Romano et al. Automated WebAssembly Function Purpose Identification With Semantics-Aware Analysis
Hendrix et al. Towards verified binary raising
Pit-Claudel Relational compilation: Functional-to-imperative code generation for performance-critical applications
JP3324542B2 (en) Virtual machine
Herrera Verification of WebAssembly programs
US20070240105A1 (en) Surrogate-based and extends-based context look-up
Ulle Source Code Analysis and Type Inference for R

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071015

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20090310