View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000160 | mercury | Bug | public | 2010-09-07 16:51 | 2010-09-14 12:26 | ||||
Reporter | maclarty | ||||||||
Assigned To | zs | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | not fixable | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000160: --optimize-fulljumps generating incorrect code | ||||||||
Description | Compile the attached file on x86_64-Linux with -O0 --optimize-fulljumps using 10.04 in grade asm_fast.gc. The resulting executable throws an exception, when it shouldn't. $ mmc --version Mercury Compiler, version 10.04, configured for x86_64-unknown-linux-gnu Copyright (C) 1993-2010 The University of Melbourne $ mmc -O0 --optimize-fulljumps bug.m $ ./bug Uncaught Mercury exception: Software Error: bug Stack dump not available in this grade. $ mmc -O0 bug.m a I've also tried with rotd-2010-08-27 on saturn. Same problem. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
Notes | |
2010-09-07 16:55 |
rotd-2010-01-30 does not appear to have the problem, so the regression seems to have been introduced this year. |
zs (developer) 2010-09-08 14:41 |
This is not a Mercury compiler bug. I checked the C code we generate, and it is correct. The problem is in gcc. The problem goes away if you specify -O0 to gcc; it also goes way if you specify only --no-tree-loop-im to gcc, with other optimizations being enabled as usual at the default optimization level. This was with gcc 4.4.1 on taura. |
zs (developer) 2010-09-08 14:51 Last edited: 2010-09-08 14:54 |
The diff between the .s files with gcc and gcc -fno-tree-loop-im is shown in DIFF.160. |
zs (developer) 2010-09-14 12:26 |
The bug is in not in mmc, but in gcc; mmc merely generated code that tickles it. A workaround that makes mmc generate code that does not tickle the gcc bug was committed on 10 sep 2010. Another workaround is to disable the gcc optimization that has the problem with --fno-tree-loop-im. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2010-09-07 16:51 |
|
New Issue | |
2010-09-07 16:51 |
|
File Added: bug.m | |
2010-09-07 16:55 |
|
Note Added: 0000282 | |
2010-09-07 19:02 |
|
Note Added: 0000283 | |
2010-09-07 19:03 |
|
Note Deleted: 0000283 | |
2010-09-08 10:40 | zs | Status | new => assigned |
2010-09-08 10:40 | zs | Assigned To | => zs |
2010-09-08 14:41 | zs | Note Added: 0000284 | |
2010-09-08 14:45 | zs | File Added: DIFF.160 | |
2010-09-08 14:51 | zs | Note Added: 0000285 | |
2010-09-08 14:54 | zs | Note Edited: 0000285 | |
2010-09-14 12:26 | zs | Note Added: 0000288 | |
2010-09-14 12:26 | zs | Status | assigned => closed |
2010-09-14 12:26 | zs | Resolution | open => not fixable |