X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FHowToSubmitABug.html;h=f01c5c72a10064052668051dbb11722a764f5589;hb=14fbcbfa2b7146569c588c451825206906c3b55a;hp=16e4c24a58b72590ca90f00c63ee2f922cb445a8;hpb=8436c21ad1a85ca1e68bca2e332fd45f024b478a;p=oota-llvm.git diff --git a/docs/HowToSubmitABug.html b/docs/HowToSubmitABug.html index 16e4c24a58b..f01c5c72a10 100644 --- a/docs/HowToSubmitABug.html +++ b/docs/HowToSubmitABug.html @@ -11,10 +11,9 @@ How to submit an LLVM bug report - - -
- + + + -
  1. Introduction - Got bugs?
  2. Crashing Bugs @@ -26,17 +25,14 @@
  3. Miscompilations
  4. Incorrect code generation (JIT and LLC)
  5. -
- -
-

Written by Chris Lattner and - Misha Brukman

+
+

Written by Chris Lattner and + Misha Brukman

-
- Debugging + + Debugging
@@ -61,7 +57,7 @@ down the bug so that the person who fixes it will be able to find the problem more easily.

Once you have a reduced test-case, go to the LLVM Bug Tracking +href="http://llvm.org/bugs/enter_bug.cgi">the LLVM Bug Tracking System, select the category in which the bug falls, and fill out the form with the necessary details. The bug description should contain the following information:

@@ -86,8 +82,8 @@ information:

More often than not, bugs in the compiler cause it to crash - often due to an -assertion failure of some sort. If you are running opt or -analyze directly, and something crashes, jump to the section on +assertion failure of some sort. If you are running opt +directly, and something crashes, jump to the section on bugs in LLVM passes. Otherwise, the most important piece of the puzzle is to figure out if it is the GCC-based front-end that is buggy or if it's one of the LLVM tools that has problems.

@@ -132,7 +128,10 @@ bunch of stuff, and should end with telling you that one of behind a foo.i file (containing preprocessed C source code) and possibly foo.s (containing LLVM assembly code), for each compiled foo.c file. Send us the foo.i file, -along with a brief description of the error it caused.

+along with a brief description of the error it caused. A tool that might help +you reduce a front-end testcase to a more manageable size is +delta. +

@@ -148,8 +147,7 @@ compilation, compile your test-case to a .s file with the -save-temps option to llvm-gcc. Then run:

-

gccas -debug-pass=Arguments < /dev/null -o - > /dev/null -

+

gccas -debug-pass=Arguments < /dev/null -o - > /dev/null

... which will print a list of arguments, indicating the list of passes that @@ -172,8 +170,9 @@ being linked together (the "llvm-gcc -v" output should include the full list of objects linked). Then run:

-

llvm-as < /dev/null > null.bc - gccld -debug-pass=Arguments null.bc

+

llvm-as < /dev/null > null.bc
+gccld -debug-pass=Arguments null.bc
+

... which will print a list of arguments, indicating the list of passes that @@ -203,12 +202,12 @@ something tractable, use the bugpoint tool as follows:

test-case, but it should eventually print something like this:

-
-...
-Emitted bytecode to 'bugpoint-reduced-simplified.bc'
-
-*** You can reproduce the problem with: opt bugpoint-reduced-simplified.bc -licm
-
+

+...
+Emitted bytecode to 'bugpoint-reduced-simplified.bc'
+
+*** You can reproduce the problem with: opt bugpoint-reduced-simplified.bc -licm
+

Once you complete this, please send the LLVM bytecode file and the command @@ -231,8 +230,9 @@ before defining them, etc.) which the verifier will check for after a pass finishes its run.

If it looks like the LLVM compiler is miscompiling a program, the very first -thing to check is to make sure it is not using undefined behavior. In -particular, check to see if the program valgrinds clean, passes purify, or some +thing to check is to make sure it is not using undefined behavior. In +particular, check to see if the program valgrinds clean, passes purify, or some other memory checker tool. Many of the "LLVM bugs" that we have chased down ended up being bugs in the program being compiled, not LLVM.

@@ -241,8 +241,8 @@ which code generator you wish to compile the program with (e.g. C backend, the JIT, or LLC) and optionally a series of LLVM passes to run. For example:

-

bugpoint -run-cbe [... optimization passes ...] file-to-test.bc ---args -- [program arguments]

+

+bugpoint -run-cbe [... optzn passes ...] file-to-test.bc --args -- [program arguments]

bugpoint will try to narrow down your list of passes to the one pass @@ -271,15 +271,21 @@ Backend, and then link in the shared object it generates.

To debug the JIT:

-

bugpoint -run-jit -output=[correct output file] [bytecode file] ---args -- [program arguments]

+
+bugpoint -run-jit -output=[correct output file] [bytecode file]  \
+         --tool-args -- [arguments to pass to lli]               \
+         --args -- [program arguments]
+

Similarly, to debug the LLC, one would run:

-

bugpoint -run-llc -output=[correct output file] [bytecode file] ---args -- [program arguments]

+
+bugpoint -run-llc -output=[correct output file] [bytecode file]  \
+         --tool-args -- [arguments to pass to llc]               \
+         --args -- [program arguments]
+

Special note: if you are debugging MultiSource or SPEC tests that @@ -288,8 +294,10 @@ debug the JIT, LLC, and CBE, using the pre-written Makefile targets, which will pass the program options specified in the Makefiles:

-

cd llvm/test/../../program
- make bugpoint-jit

+

+cd llvm/test/../../program
+make bugpoint-jit +

At the end of a successful bugpoint run, you will be presented @@ -302,28 +310,32 @@ the following:

    -
  1. Regenerate the shared object from the safe bytecode file:

    +
  2. Regenerate the shared object from the safe bytecode file:

    -
    -

    llc -march=c safe.bc -o safe.c
    - gcc -shared safe.c -o safe.so

    -
  3. +
    +

    +llc -march=c safe.bc -o safe.c
    +gcc -shared safe.c -o safe.so +

    +
    -
  4. If debugging LLC, compile test bytecode native and link with the shared - object:

    +
  5. If debugging LLC, compile test bytecode native and link with the shared + object:

    -
    -

    llc test.bc -o test.s -f
    - gcc test.s safe.so -o test.llc
    - ./test.llc [program options]

    -
  6. - -
  7. If debugging the JIT, load the shared object and supply the test - bytecode:

    +
    +

    +llc test.bc -o test.s -f
    +gcc test.s safe.so -o test.llc
    +./test.llc [program options] +

    +
  8. + +
  9. If debugging the JIT, load the shared object and supply the test + bytecode:

    -
    -

    lli -load=safe.so test.bc [program options]

    -
  10. +
    +

    lli -load=safe.so test.bc [program options]

    +
@@ -338,7 +350,7 @@ the following:

src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Chris Lattner
- The LLVM Compiler Infrastructure + The LLVM Compiler Infrastructure
Last modified: $Date$