http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60606

D.Salikhov <d.salikhov at samsung dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |---

--- Comment #4 from D.Salikhov <d.salikhov at samsung dot com> ---
(In reply to Richard Earnshaw from comment #3)
> >        register unsigned long pc asm("pc");
> 
> I think it's a mistake to permit this sort of construct.  
> 
> What does:
> 
>   a = pc;
>   b = a+pc;
> 
> generate for b?  Is it exactly twice a (the compiler doesn't see pc
> changing, so is free to assume that it doesn't), just more than twice a (how
> much more?) or just less than twice a (different scheduling)?  What happens
> if the user writes
> 
>   pc = 3; // ???
> 
> The point is that while it might be valid to use pc in assembly
> instructions, the constructs you get in high-level languages are essentially
> meaningless.

Well, even if I use PC incorrectly (actually I don't), it shouldn't lead to
ICE. At least, there should be a sensible error message from compiler but not
internal error.

> 
> As has been pointed out, in the few cases where you really need to extract
> the program counter you can write an inline assembly statement that
> explicitly references the PC.

Reply via email to