Issue Details (XML | Word | Printable)

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

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

assign to a register variable gives major internal compiler error

Created: 13/Aug/12 09:15 PM   Updated: 19/Aug/12 09:42 AM
Component/s: C frontend, Common code, i386 target, pcc backend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386 with pcc 1.1.0.DEVEL 20120813 for netbsd-i386

 Description  « Hide

The following example code

void foo(void)
        register int a = 0;

when compiled with "pcc -c", fails with a major internal compiler error

major internal compiler error: test.c, line 4
/usr/libexec/ccom terminated with status 1

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 18/Aug/12 10:37 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson added a comment - 18/Aug/12 10:38 PM
Fixed. register is now ignored when it comes to space allocation.

Anders Magnusson made changes - 18/Aug/12 10:38 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Roland Mainz added a comment - 18/Aug/12 10:43 PM
Erm... does |register| still force the compiler to try to find a free (and more or less permanent) register for the matching variable ? AFAIK |register| (if we exclude usage like on AmigaOS SAS/C) is only a "hint" that - if possible - a register should be used as storage... right ?

Anders Magnusson added a comment - 19/Aug/12 09:42 AM
Well, usually the register keyword is just ignored, but:

The construction
    register int foo asm("r4");
is a gcc extension that asks for foo to be kept in r4. When I added this extension the bug in this bug report showed up.