Issue Details (XML | Word | Printable)

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

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

passing struct pointer to function with regparm attribute causes compiler error

Created: 11/May/14 09:29 PM   Updated: 24/May/14 05:20 PM
Component/s: C frontend, i386 target, pcc backend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
passing a struct pointer to a function with regparm attribute causes a compiler error.

The following code (derived from libexpat, which seems to use regparm heavily)

struct foo {
        int a;
        int b;
void __attribute__((regparm(3)))
foo(struct foo *a)

when compiled with "pcc -c" fails with the following diagnostic

test.c, line 8: compiler error: strmemb
/usr/libexec/ccom terminated with status 1

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 12/May/14 11:20 AM
It seems like structs are passed on stack also if regparm. Need some rework.

Anders Magnusson added a comment - 24/May/14 05:20 PM
Now regparm should work as intended, but I doubt it gives any significant speedup to use it.