<< Back to previous view

[PCC-400] assign to a register variable gives major internal compiler error Created: 13/Aug/12  Updated: 19/Aug/12

Status: Resolved
Project: pcc
Component/s: C frontend, Common code, i386 target, pcc backend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Fixed Votes: 1
Environment: NetBSD/i386 with pcc 1.1.0.DEVEL 20120813 for netbsd-i386


 Description   

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


 Comments   
Comment by Anders Magnusson [ 18/Aug/12 10:38 PM ]
Fixed. register is now ignored when it comes to space allocation.
Comment by Roland Mainz [ 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 ?
Comment by Anders Magnusson [ 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.
Generated at Thu Jul 10 09:24:33 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.