View Issue Details

IDProjectCategoryView StatusLast Update
0032006FPCCompilerpublic2019-12-27 09:06
ReporterChristo CrauseAssigned ToFlorian 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformEmbedded avrOSOS Version
Product Version3.1.1Product Build36496 
Target VersionFixed in Version3.3.1 
Summary0032006: Internal error 200103281 on floating point division
DescriptionAn internal compiler error gets generated when the source contains a divide operator.
Steps To ReproduceExample 1:

program project1;
const float = 1000 / 3;
begin end.

Example2:

program project2;
var a: byte;
begin
  a := 3/4;
end.

Compiled with:
~/fpc/3.1.1/compiler/ppcrossavr -Tembedded -Wpatmega328p -Cpavr5 -Pavr -g -a -XPavr- -Sm -dF_CPU:=16000000 $1
Additional InformationI assume that floating point math is not implemented yet for this target, but I did not expect an internal error.
TagsAVR
Fixed in Revision43794
FPCOldBugId
FPCTarget-
Attached Files

Activities

Christo Crause

2018-08-19 07:42

reporter   ~0110144

Until floating point support is added to the AVR target, I would suggest the parser simply emit an error when encountering anything resulting in a floating point type.

Florian

2018-08-20 11:21

administrator   ~0110164

This is not a matter of the parser but the semantic analysis/code generator. Nevertheless, this is much harder than it sounds as possible locations where this can happen is spread over the whole compiler so I better invest my time in making floats working :)

Christo Crause

2018-08-22 18:53

reporter   ~0110240

As a minimalist I don't consider floating point support as urgent, but once some Arduino users start using FPC I'm sure it will be missed. OK I will also use it if available and lightweight enough :)

Andi Friess

2019-06-21 21:04

reporter   ~0116828

Last edited: 2019-06-21 21:06

View 2 revisions

program project1;
const word = 1000 div 3;
begin end.

Is working, so it can be a workaround if you want to work with integers only and not with floating point values.

Christo Crause

2019-06-22 21:43

reporter   ~0116857

Andi - yes div is a work-around. My issue is rather that the compiler should give a meaningful error message, not an internal error if I use an unsupported feature.

Christo Crause

2019-12-27 09:06

reporter   ~0120082

Thanks Florian.

Issue History

Date Modified Username Field Change
2017-06-13 07:04 Christo Crause New Issue
2017-06-13 07:59 Christo Crause Tag Attached: AVR
2018-08-19 07:42 Christo Crause Note Added: 0110144
2018-08-20 11:21 Florian Note Added: 0110164
2018-08-22 18:53 Christo Crause Note Added: 0110240
2019-06-21 21:04 Andi Friess Note Added: 0116828
2019-06-21 21:06 Andi Friess Note Edited: 0116828 View Revisions
2019-06-22 21:43 Christo Crause Note Added: 0116857
2019-12-25 19:09 Florian Assigned To => Florian
2019-12-25 19:09 Florian Status new => resolved
2019-12-25 19:09 Florian Resolution open => fixed
2019-12-25 19:09 Florian Fixed in Version => 3.3.1
2019-12-25 19:09 Florian Fixed in Revision => 43794
2019-12-25 19:09 Florian FPCTarget => -
2019-12-27 09:06 Christo Crause Status resolved => closed
2019-12-27 09:06 Christo Crause Note Added: 0120082