These document describes the release notes for older versions of the
compiler
application.Compiler 1.2.1
Fixed errors and malfunctions
- An incorrect reference to
asm
is removed from thecompile
reference manual.
Own Id: OTP-2619Improvements and new features
- It used to be the case that ?P and ?'P' (i.e., macro names starting with an uppercase letter) were references to different macros. This had the consequence that the form without quotes, which is the natural form to use, could not be set from outside the source file (for example, using the -D option to 'erlc'). Now, ?P and ?'P' have been made equivalent, so that "erl -DP=1" causes both ?P and ?'P' to expand to 1.
Own Id: OTP-2608Compiler 1.2
Fixed errors and malfunctions
- Giving floating points attributes in module attributes (like
-vsn(1.0)
) used to crash the Erlang compiler. This has been corrected.
Own Id: OTP-2141
Aux Id: seq 623, OTP-2302Improvements and new features
- The
fast
option has been removed.
The object code format is partly documented (see thecompile
module). With the help of this documentation, tools can be written to inspect, change, delete, or add module attributes. Also, function call tracing can be enabled or disabled by changing a single bit in the header of the object code.
Own Id: OTP-2262
Aux Id: seq 718- The escape sequences \s in strings and $\s outside strings now give the ASCII code for space. It is recommended to use $\s instead of dollar followed by space, for readability reasons. Note that $\s in earlier releases was equivalent to $s.
Own Id: OTP-2522R3B02 (Compiler 1.1.5)
Fixed errors and malfunctions
- A
fun
could not be used in a record initializer.
Own Id: OTP-2173
Aux Id: seq 649- The compiler sometimes failed to compile modules where conditions were invariably false (e.g.
case 1 of [X] -> ...
).
Own Id: OTP-2330
Aux Id: seq 791- Using a literal atom as case expression and more than five matching atoms, the compiler would generate a module which cannot be loaded. This has been corrected.
Own Id: OTP-2380
Aux Id: seq 701,HA77209R3B (Compiler 1.1.4)
Improvements and new features
- The BEAM compiler will give a diagnostic if the trace and fast options are combined (earlier it silently ignored the trace flag, producing fast code which couldn't trace BIFs).
(*** POTENTIAL INCOMPATIBILITY ***)
Own Id: OTP-1954
Aux Id: seq 442R3A (Compiler 1.1.3)
Fixed errors and malfunctions
- An error in the beam-compiler which caused an internal error when compiling e.g. a list match like this:
[H | T] = foo(),
where H is not used in the function is corrected.
Own Id: OTP-1476- In the Beam compiler, the calculation of heap usage for a
case
orreceive
statement was overly pessimistic in some cases, resulting in the allocation of unnecessary large process heaps or in the extreme case a load error for the module ("Error while loading -PASS 2-"). This has been corrected.
Own Id: OTP-1713- The beam-compiler is corrected regarding a catch inside a catch (in the same function). All exits ended up in the outermost catch, which was wrong.
Own Id: OTP-1834
Aux Id: SEQ 400Known problems
- Giving floating points attributes in module attributes (like
-vsn(1.0) ) crashes the Erlang compiler.
Own Id: OTP-21412 Compiler 1.1.2
2.1 Incompatibilities with Compiler 1.1.1
Due to corrections listed below, all BEAM code must be recompiled (see also release notes for ERTS).
2.2 Fixed bugs and malfunctions
- Wrong restart of send at busy or garbage collect (BEAM, fast compiled code).
Own Id:OTP-1420
- Bad arithmetic in guard fails instead of matching the next clause (BEAM).
Own Id:OTP-1422
2.3 Known bugs and problems
- The BEAM compiler terminates with error
beam_asm_int: EXIT
when a list match is performed as in[H| T] = foo()
, in case variableT
is subsequently used, whileH
is not. The work-around is to writeT = tl(foo())
instead.
Own Id: OTP-1476
3 Compiler 1.1.1
3.1 Incompatibilities with Compiler 1.1
Due to corrections listed below, all BEAM code must be recompiled (see also release notes for ERTS).
3.2 Fixed bugs and malfunctions
- Correction of register allocation error in creation of tuples in guards in BEAM.
Own Id:OTP-1390
- Correction of compiler error for BEAM which caused
ig
to generate erroneous code (error in nested case statements).
Own Id:OTP-1392
Aux Id:HA48119
4 Compiler 1.1
4.1 Improvements and new features
- To simplify maintenance and cross compilations the two compiler directories, compiler_jam and compiler_beam, has been merged into a single compiler directory. Most modules names have been changed to avoid confusion and name collisions. The only user visible change is that the compilation target (jam or beam) can be specified in the list of arguments. E.g.
compile:file(foo, [beam, verbose, report]).4.2 Incompatibilities with Compiler 1.0
4.3 Fixed bugs and malfunctions
- Compiler crashed on "silly" record update like this:
-record(bar, {hello}). compilerCrash() -> R1 = #bar{}, R2 = R1#bar{}, % <--- This causes the compiler to crash with the not_ok.Own Id:OTP-1204,OTP-1208
- The compiler does not check that record fields in a match are unique. Example:
-module(compiler_6_SUITE). -record(foo, {bar}). f() -> #foo{bar = X,bar = Y} = x, Y. 56> c(compiler_6_SUITE). *** unset variable:'Y' in line:7bar
is repeated twice in the above example and the compiler does not detect that as an error which causes the assignment ofY
to be silently ignored ...
Own Id:OTP-1231
5 Compiler 1.0.1
5.1 Improvements and new features
5.2 Incompatibilities with Compiler 1.0
5.3 Fixed bugs and malfunctions
- The compiler no longer crashes on too long atoms (> 255).
Own Id: OTP-1012
- The compiler
erl_lint
did earlier assume that some language constructs aways resided on the same line in the source code which caused a white space to be significant when determing an error or not. This is corrected.
Example:
-module(test). -compile(export_all). -record(test, {a,b}). rectest(R) when record(R, test) -> ok. rectest2(R) when record(R, test) -> ok. (test@etxbc29)3> c(test). ./test.erl:7: illegal guard expressionOwn Id: OTP-1077
- The compiler crashes on unsafe variable in nested case. This is corrected.
Own Id: OTP-1104
6 Compiler 1.0
6.1 Improvements and new features
- A new include directive
-include_lib()
is introduced. Example:
-include_lib("mnesia/include/mnemosyne.hrl").This instructs the compiler (preprocessor) to look for the directory where the application calledmnesia
is installed and then looks in the subdirectoryinclude
for the filemnemosyne.hrl
. The preprocessor first looks in the orinary preprocessor search path to allow explicit overloading of the include files.
- The new compiler options
{i, IncludeDir}
and {d, Def} are introduced.
6.2 Incompatibilities with Compiler P1C
There are two new reserved words
let
andquery
.
let
will be used in the future when a language construction similar to let in Lisp will be implemented.
query
is used when making queries to Mnesia tables with the Mnemosyne query language.
6.3 Fixed bugs and malfunctions
-