[armel] gcc computes wrong address for main() at build time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Fix Released
|
Medium
|
Richard Sandiford | ||
4.5 |
Fix Released
|
Medium
|
Richard Sandiford | ||
4.6 |
Fix Released
|
Medium
|
Richard Sandiford | ||
gcc |
Fix Released
|
Medium
|
|||
gcc-4.5 (Ubuntu) |
Fix Released
|
High
|
Linaro Tool Chain Working Group | ||
Natty |
Won't Fix
|
High
|
Linaro Tool Chain Working Group | ||
Oneiric |
Fix Released
|
High
|
Linaro Tool Chain Working Group | ||
gcc-4.6 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Natty |
Invalid
|
Undecided
|
Unassigned | ||
Oneiric |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: gcc-4.5
During the debugging of mono, we found a confirmed tool chain regression and isolated it down to a testcase:
Test code:
void main() {
void *p = main;
if ((int)p & 1) printf ("HIT!\n");
}
Output:
mcasadevall@
test.c: In function 'main':
test.c:3:18: warning: incompatible implicit declaration of built-in function 'printf'
mcasadevall@
HIT!
mcasadevall@
test.c: In function 'main':
test.c:3:18: warning: incompatible implicit declaration of built-in function 'printf'
mcasadevall@
mcasadevall@
Doesn't occur with gcc-4.4.
Additional comments from #monodev:
16:26:58 < vargaz> NCommander: it seems to think function addresses on arm
Related branches
- Linaro Toolchain Developers: Pending requested
-
Diff: 183 lines (+96/-16) (has conflicts)4 files modifiedChangeLog.linaro (+52/-0)
gcc/builtins.c (+23/-2)
gcc/fold-const.c (+6/-14)
gcc/testsuite/gcc.dg/torture/pr49169.c (+15/-0)
- Ramana Radhakrishnan (community): Approve
-
Diff: 199 lines (+97/-20) (has conflicts)5 files modifiedChangeLog.linaro (+53/-0)
gcc/builtins.c (+23/-2)
gcc/fold-const.c (+6/-14)
gcc/testsuite/gcc.dg/torture/pr49169.c (+15/-0)
gcc/tree-ssa-ccp.c (+0/-4)
Changed in gcc-4.5 (Ubuntu Natty): | |
status: | Confirmed → Triaged |
Changed in gcc-linaro: | |
status: | New → Confirmed |
Changed in gcc-4.5 (Ubuntu Natty): | |
assignee: | nobody → Linaro Tool Chain Working Group (linaro-toolchain-wg) |
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in gcc-linaro: | |
assignee: | nobody → Richard Sandiford (rsandifo) |
Changed in gcc-linaro: | |
status: | Triaged → In Progress |
Changed in gcc-linaro: | |
milestone: | none → 4.6-2011.07 |
Changed in gcc: | |
status: | New → Confirmed |
Changed in gcc-4.6 (Ubuntu Natty): | |
status: | New → Invalid |
Changed in gcc: | |
status: | Confirmed → Fix Released |
Amendment: Also occurs on amd64
mcasadevall@ daybreak: /tmp$ uname -a daybreak: /tmp$ gcc -O2 test.c
Linux daybreak 2.6.38-2-generic #29-Ubuntu SMP Fri Feb 4 13:03:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
mcasadevall@
test.c: In function ‘main’:
test.c:3:13: warning: cast from pointer to integer of different size
test.c:3:25: warning: incompatible implicit declaration of built-in function ‘printf’