AVR - compiler raises exception when encountering a branch instruction with absolute value
Original Reporter info from Mantis: ccrause @ccrause
-
Reporter name: Christo Crause
Original Reporter info from Mantis: ccrause @ccrause
- Reporter name: Christo Crause
Description:
When compiling assembler code with a branch instruction containing an absolute offset the compiler raises an exception:
Free Pascal Compiler version 3.1.1 [2017/07/04] for avr
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Embedded
Compiling intmathtest.pp
intmathtest.pp(27,1) Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $00000000004E9894:
EAccessViolation: Access violation
$00000000004E9894
Steps to reproduce:
Create a program with an assembler block with a branch instruction with an absolute offset:
program test;
begin
asm
breq 0
end;
end.
Compile with cross compiler for avr: ppcrossavr -Tembedded -Wpatmega328p -Cpavr5 -Pavr -O3 -g -a -al -XPavr--v -v -v -Sm -dF_CPU:=16000000
Additional information:
I've tested a few other branch instructions and different offsets, always the same compiler error. Note that I don't actually want to use an absolute offset, it was merely a typo which resulted in this exception.
Also switching optimization off doesn't change this.