<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/compiler/src, branch OTP-19.1.1</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>beam_validator: Handle unreachable instructions</title>
<updated>2016-09-13T11:27:28+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-09-13T10:35:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=81c5e15544679baeeb8c18b72156b79aa4badebb'/>
<id>81c5e15544679baeeb8c18b72156b79aa4badebb</id>
<content type='text'>
ab03678e introduced an optimization in the beam_z pass that could
introduce unreachable code in BEAM files (a 'jump' instruction is
removed after a 'raise' instruction, but the code following the
target of the 'jump' is not removed).

Since this situation happens very rarely, there is no point in adding
another pass that can remove unreachable code after beam_z. Instead we
will make sure that beam_validator can skip the unreachable code.
Skipping unreachable code is already done in valfun_1/2 (for
historical reasons), but we will also need to do it in val_dsetel/2.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ab03678e introduced an optimization in the beam_z pass that could
introduce unreachable code in BEAM files (a 'jump' instruction is
removed after a 'raise' instruction, but the code following the
target of the 'jump' is not removed).

Since this situation happens very rarely, there is no point in adding
another pass that can remove unreachable code after beam_z. Instead we
will make sure that beam_validator can skip the unreachable code.
Skipping unreachable code is already done in valfun_1/2 (for
historical reasons), but we will also need to do it in val_dsetel/2.
</pre>
</div>
</content>
</entry>
<entry>
<title>sys_core_fold: Don't move a fun into a guard</title>
<updated>2016-09-05T10:56:12+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-09-05T10:47:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=f9d516285dfec7db4333e919ca71e7eb0e6a41ed'/>
<id>f9d516285dfec7db4333e919ca71e7eb0e6a41ed</id>
<content type='text'>
Moving a fun into a guard may cause code that is not accepted
by beam_validator.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Moving a fun into a guard may cause code that is not accepted
by beam_validator.
</pre>
</div>
</content>
</entry>
<entry>
<title>[ERL-209] Fix ambiguous_catch_try_state inconsistency error</title>
<updated>2016-08-11T13:43:46+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-08-11T13:35:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=d39cac954fc76a838763ac1ac03cb71bf8e5d68d'/>
<id>d39cac954fc76a838763ac1ac03cb71bf8e5d68d</id>
<content type='text'>
It is not safe to share code between 'catch' blocks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is not safe to share code between 'catch' blocks.
</pre>
</div>
</content>
</entry>
<entry>
<title>beam_block: Fix potentially unsafe optimization in move_allocates/1</title>
<updated>2016-08-05T08:58:12+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-08-01T15:06:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=921cf991e09698d63d0f4f9a20bf2cfc23b2e896'/>
<id>921cf991e09698d63d0f4f9a20bf2cfc23b2e896</id>
<content type='text'>
beam_block has an optimization that only is safe when it is applied
immediately after code generation. That is pointed out in a comment:

  NOTE: Moving allocation instructions is only safe because it is done
  immediately after code generation so that we KNOW that if {x,X} is
  initialized, all x registers with lower numbers are also initialized.
  That assumption may not be true after other optimizations, such as
  the beam_utils:live_opt/1 optimization.

The new beam_reorder pass added in OTP 19 runs before beam_block.
Therefore, the optimization is potentially unsafe. The optimization
is also unsafe if compilation is started from assembly code in a
.S file.

Rewrite the optimization to make it safe. See the newly added comment
for details.

ERL-202
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
beam_block has an optimization that only is safe when it is applied
immediately after code generation. That is pointed out in a comment:

  NOTE: Moving allocation instructions is only safe because it is done
  immediately after code generation so that we KNOW that if {x,X} is
  initialized, all x registers with lower numbers are also initialized.
  That assumption may not be true after other optimizations, such as
  the beam_utils:live_opt/1 optimization.

The new beam_reorder pass added in OTP 19 runs before beam_block.
Therefore, the optimization is potentially unsafe. The optimization
is also unsafe if compilation is started from assembly code in a
.S file.

Rewrite the optimization to make it safe. See the newly added comment
for details.

ERL-202
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'maint-19' into maint</title>
<updated>2016-07-15T10:22:45+00:00</updated>
<author>
<name>Björn-Egil Dahlberg</name>
<email>egil@erlang.org</email>
</author>
<published>2016-07-15T10:22:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=440445cfd0cbeee8f2bb86b99b6d16caf7a5c9c7'/>
<id>440445cfd0cbeee8f2bb86b99b6d16caf7a5c9c7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "beam_dead: Improve optimization of literal binary matching"</title>
<updated>2016-07-12T14:12:50+00:00</updated>
<author>
<name>Björn-Egil Dahlberg</name>
<email>egil@erlang.org</email>
</author>
<published>2016-07-12T14:12:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=dd1162846eb7942243ea285310cf100b6959a845'/>
<id>dd1162846eb7942243ea285310cf100b6959a845</id>
<content type='text'>
This reverts commit 105c5b0071056dc062797e58772e098d2a3a4627.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 105c5b0071056dc062797e58772e098d2a3a4627.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'aronisstav/compiler/fix-compile-forms-spec/PR-1109' into maint</title>
<updated>2016-06-30T08:27:45+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-06-30T08:27:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=c2157dc06a8c997c207dd82cd6fa11dbcb508f11'/>
<id>c2157dc06a8c997c207dd82cd6fa11dbcb508f11</id>
<content type='text'>
* aronisstav/compiler/fix-compile-forms-spec/PR-1109:
  Fix spec of compile:(noenv_)forms/2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* aronisstav/compiler/fix-compile-forms-spec/PR-1109:
  Fix spec of compile:(noenv_)forms/2
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix try-catch when writing makefile</title>
<updated>2016-06-23T09:04:12+00:00</updated>
<author>
<name>Magnus Henoch</name>
<email>magnus.henoch@gmail.com</email>
</author>
<published>2016-06-23T09:04:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=10ea3707cb220d1b936ce103e78d2a500e6c03e6'/>
<id>10ea3707cb220d1b936ce103e78d2a500e6c03e6</id>
<content type='text'>
Any exceptions at this point would be of class error, not exit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Any exceptions at this point would be of class error, not exit.
</pre>
</div>
</content>
</entry>
<entry>
<title>Show error reason when compiler cannot write file</title>
<updated>2016-06-22T12:45:18+00:00</updated>
<author>
<name>Magnus Henoch</name>
<email>magnus.henoch@gmail.com</email>
</author>
<published>2016-06-22T12:45:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=fe954ec3f29cfff9f421ae967b47fc9aac24c248'/>
<id>fe954ec3f29cfff9f421ae967b47fc9aac24c248</id>
<content type='text'>
When the compiler fails to write an output file, it used to just print
"error writing file".  With this change, it also prints the error
reason:

    $ echo "-module(foo)." &gt; foo.erl
    $ chmod -w .
    $ erlc foo.erl
    /tmp/bar/foo.bea#: error writing file: permission denied
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the compiler fails to write an output file, it used to just print
"error writing file".  With this change, it also prints the error
reason:

    $ echo "-module(foo)." &gt; foo.erl
    $ chmod -w .
    $ erlc foo.erl
    /tmp/bar/foo.bea#: error writing file: permission denied
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix spec of compile:(noenv_)forms/2</title>
<updated>2016-06-20T15:54:26+00:00</updated>
<author>
<name>Stavros Aronis</name>
<email>aronisstav@gmail.com</email>
</author>
<published>2016-06-20T14:53:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=9aabc64783ee1a1fbcd5b80ea03f9ef12807cb92'/>
<id>9aabc64783ee1a1fbcd5b80ea03f9ef12807cb92</id>
<content type='text'>
The input for a call to compile:(noenv_)forms/2 can also be a cerl
module (useful e.g. to resume with 'from_core' after a 'to_core'
compilation).

Internal representations used for 'from_asm' and 'from_beam'
compilation can also be valid, but have no relevant types defined.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The input for a call to compile:(noenv_)forms/2 can also be a cerl
module (useful e.g. to resume with 'from_core' after a 'to_core'
compilation).

Internal representations used for 'from_asm' and 'from_beam'
compilation can also be valid, but have no relevant types defined.
</pre>
</div>
</content>
</entry>
</feed>
