cselim tree optimizer generates incorrect code
Bug #1029454 reported by
Stéphane Glondu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Fix Released
|
High
|
Matthew Gretton-Dann | ||
gcc-4.6 (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Precise |
Won't Fix
|
High
|
Unassigned |
Bug Description
I think gcc (4.6.3-1ubuntu5, amd64) generates incorrect code with the attached test case.
The expected output is "m = 8241071186". However, when compiled with "-O3", it outputs "m = 1". Looking further, it seems that the following lines:
*m = 1UL;
ularith_
are being swapped in the assembly output.
The output is correct when compiled with "-O2" or with "-O3 -fno-tree-cselim".
On Debian (version 4.6.3-1), the output is always correct. I have reports that the output is correct with upstream gcc compiled on Ubuntu, so this behaviour looks Ubuntu-specific.
Related branches
lp://staging/~matthew-gretton-dann/gcc-linaro/4.6-cselim-fix
- Christophe Lyon: Approve
- Michael Hope: Pending requested
Changed in gcc-4.6 (Ubuntu): | |
importance: | Undecided → High |
milestone: | none → precise-updates |
status: | New → Triaged |
Changed in gcc-linaro: | |
assignee: | nobody → Matthew Gretton-Dann (matthew-gretton-dann) |
tags: | added: precise quantal rls-q-incoming |
Changed in gcc-4.6 (Ubuntu Precise): | |
importance: | Undecided → High |
milestone: | none → precise-updates |
status: | New → Triaged |
Changed in gcc-4.6 (Ubuntu): | |
milestone: | precise-updates → none |
Changed in gcc-linaro: | |
milestone: | none → 4.6-2012.10 |
Changed in gcc-linaro: | |
status: | Triaged → In Progress |
Changed in gcc-linaro: | |
status: | In Progress → Fix Committed |
Changed in gcc-linaro: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The version in quantal (4.6.3-8ubuntu1) is not affected.