Issue Details (XML | Word | Printable)

Key: PCC-268
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

function (symbol?) renaming does not work with pre-declared functions

Created: 01/Mar/11 10:10 PM   Updated: 01/May/14 02:31 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386


 Description  « Hide
The following code

void bar(void);

static inline void foo(void)
{
bar();
}

void bar(void) asm("__bar");

void baz(void)
{
foo();
bar();
}

when compiled with "pcc -S":

.text
.align 4
.globl baz
.type baz,@function
baz:
pushl %ebp
movl %esp,%ebp
.L16:
.L18:
call foo
call __bar
.L17:
leave
ret
.size baz,.-baz
.align 4
foo:
pushl %ebp
movl %esp,%ebp
.L19:
.L21:
call bar
.L20:
leave
ret
.size foo,.-foo
.ident "PCC: pcc 1.1.0.DEVEL [20110221] (netbsd)"

shows a call to bar() from the foo() function even though its written out after the declaration that renames the symbol

..arguably this code is slightly controversial though it does work with gcc..

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 01/May/14 02:30 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 01/May/14 02:31 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]