<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/compiler/test, branch OTP-21.3.1</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>Eliminate bogus warning when using tuple calls</title>
<updated>2019-01-30T14:25:14+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2019-01-30T14:19:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=5f9b6873499882d32280883edaa97d7d0f526035'/>
<id>5f9b6873499882d32280883edaa97d7d0f526035</id>
<content type='text'>
There would be a bogus warning when compiling the following
function with the `tuple_calls` option:

    dispatch(X) -&gt;
        (list_to_atom("prefix_" ++ atom_to_list(suffix))):doit(X).

The warning would look like this:

    no_file: this expression will fail with a 'badarg' exception

https://bugs.erlang.org/browse/ERL-838
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There would be a bogus warning when compiling the following
function with the `tuple_calls` option:

    dispatch(X) -&gt;
        (list_to_atom("prefix_" ++ atom_to_list(suffix))):doit(X).

The warning would look like this:

    no_file: this expression will fail with a 'badarg' exception

https://bugs.erlang.org/browse/ERL-838
</pre>
</div>
</content>
</entry>
<entry>
<title>beam_type: Eliminate compiler crash when arithmetic expression fails</title>
<updated>2019-01-14T14:23:08+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2019-01-12T05:43:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=c9f5fdb5c92c418f28d67bb62ea8baac296da5ac'/>
<id>c9f5fdb5c92c418f28d67bb62ea8baac296da5ac</id>
<content type='text'>
The compiler would crash when compiling code such as:

     (A / B) band 16#ff

The type for the expression would be 'none', but beam_type:verified_type/1
did not handle 'none'.

https://bugs.erlang.org/browse/ERL-829
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The compiler would crash when compiling code such as:

     (A / B) band 16#ff

The type for the expression would be 'none', but beam_type:verified_type/1
did not handle 'none'.

https://bugs.erlang.org/browse/ERL-829
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unsafe optimization for delaying creation of stackframe</title>
<updated>2019-01-07T11:55:26+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-12-18T11:59:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=7a01269e62f21ac3ba9858dd358716081549bea3'/>
<id>7a01269e62f21ac3ba9858dd358716081549bea3</id>
<content type='text'>
b89044a800c4 introduced an optimization that tries to delay creation
of stack frames. It turns out that this optimization is not always
safe. (See the new test case for an example.)

Since the code generator is completely rewritten in the `master`
branch for the upcoming OTP 22 release, it does not make sense trying
to mend this optimization. It is better to remove it.  Out of a sample
of about 1000 modules in OTP, about 50 of them are changed as a result
of removing this optimization.

The compiler in OTP 22 will do the same optimization in a cleaner,
safer, and more effective way.

https://bugs.erlang.org/browse/ERL-807
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
b89044a800c4 introduced an optimization that tries to delay creation
of stack frames. It turns out that this optimization is not always
safe. (See the new test case for an example.)

Since the code generator is completely rewritten in the `master`
branch for the upcoming OTP 22 release, it does not make sense trying
to mend this optimization. It is better to remove it.  Out of a sample
of about 1000 modules in OTP, about 50 of them are changed as a result
of removing this optimization.

The compiler in OTP 22 will do the same optimization in a cleaner,
safer, and more effective way.

https://bugs.erlang.org/browse/ERL-807
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix unsafe optimization of stack trace building</title>
<updated>2018-12-05T13:07:04+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-12-05T13:01:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=b3bd35ccd0004d59e478308df3bc85c351557f3c'/>
<id>b3bd35ccd0004d59e478308df3bc85c351557f3c</id>
<content type='text'>
The `sys_core_fold` pass of the compiler would optimize
away the building of the stacktrace in code such as:

    try
        ...
    catch
        C:R:Stk -&gt;
           erlang:raise(C, {R,Stk}, Stk)
    end

That optimization is unsafe and would cause a crash in a later compiler
pass.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `sys_core_fold` pass of the compiler would optimize
away the building of the stacktrace in code such as:

    try
        ...
    catch
        C:R:Stk -&gt;
           erlang:raise(C, {R,Stk}, Stk)
    end

That optimization is unsafe and would cause a crash in a later compiler
pass.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix internal consistency failure for is_function/2</title>
<updated>2018-11-20T12:13:26+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-11-20T12:05:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=8be2c32fe0534d863c6ce6d7665011a162fc39ec'/>
<id>8be2c32fe0534d863c6ce6d7665011a162fc39ec</id>
<content type='text'>
There could be an internal consistency failure when using is_function/2,
because an optimization did not take into account that is_function/2 can fail.

https://bugs.erlang.org/browse/ERL-778
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There could be an internal consistency failure when using is_function/2,
because an optimization did not take into account that is_function/2 can fail.

https://bugs.erlang.org/browse/ERL-778
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bug when beam_jump removes put_tuple instructions</title>
<updated>2018-10-31T12:18:42+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-10-31T12:07:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=94517048c3dad66c6c6469088d174cefcbbdb552'/>
<id>94517048c3dad66c6c6469088d174cefcbbdb552</id>
<content type='text'>
`beam_jump` could remove a `put_tuple` instruction when the
tuple would not be used, but it would leave the following
`put` instructions. Make sure they are removed.

https://bugs.erlang.org/browse/ERL-759
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`beam_jump` could remove a `put_tuple` instruction when the
tuple would not be used, but it would leave the following
`put` instructions. Make sure they are removed.

https://bugs.erlang.org/browse/ERL-759
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'john/compiler/bs_match-anno-liveness-fix/OTP-15353/ERL-753' into maint</title>
<updated>2018-10-16T08:34:03+00:00</updated>
<author>
<name>John Högberg</name>
<email>john@erlang.org</email>
</author>
<published>2018-10-16T08:34:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=41ab6463e73011969498969834b4ee84024748b0'/>
<id>41ab6463e73011969498969834b4ee84024748b0</id>
<content type='text'>
* john/compiler/bs_match-anno-liveness-fix/OTP-15353/ERL-753:
  beam_utils: Handle bs_start_match2 in anno_defs
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* john/compiler/bs_match-anno-liveness-fix/OTP-15353/ERL-753:
  beam_utils: Handle bs_start_match2 in anno_defs
</pre>
</div>
</content>
</entry>
<entry>
<title>beam_utils: Handle bs_start_match2 in anno_defs</title>
<updated>2018-10-15T11:15:13+00:00</updated>
<author>
<name>John Högberg</name>
<email>john@erlang.org</email>
</author>
<published>2018-10-15T08:30:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=59e5879164f0c11d2063e4eecb8a7052e2f4a04a'/>
<id>59e5879164f0c11d2063e4eecb8a7052e2f4a04a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>compiler: Forward +source flag to epp and fix bug in +deterministic</title>
<updated>2018-10-05T09:47:57+00:00</updated>
<author>
<name>John Högberg</name>
<email>john@erlang.org</email>
</author>
<published>2018-10-05T08:06:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=3a34f37fbc5af8eca7a70f5dab61dca7ee1706b0'/>
<id>3a34f37fbc5af8eca7a70f5dab61dca7ee1706b0</id>
<content type='text'>
The source file path as given to `erlc` was included in an implicit
file attribute inserted by epp, even when the +source flag was
set to something else which was a bit surprising. It was also
included when +deterministic was specified, breaking the flag's
promise.

This commit forwards the +source flag to epp so it inserts the
right information, and if +deterministic is given it will be shaved
to just the base name of the file, guaranteeing the same result
regardless of how the input is reached.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The source file path as given to `erlc` was included in an implicit
file attribute inserted by epp, even when the +source flag was
set to something else which was a bit surprising. It was also
included when +deterministic was specified, breaking the flag's
promise.

This commit forwards the +source flag to epp so it inserts the
right information, and if +deterministic is given it will be shaved
to just the base name of the file, guaranteeing the same result
regardless of how the input is reached.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix rare bug in binary matching (again)</title>
<updated>2018-09-28T08:47:56+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-09-28T03:57:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=0bb261b730eff06cca524ea9999ff035585ef5b4'/>
<id>0bb261b730eff06cca524ea9999ff035585ef5b4</id>
<content type='text'>
2e40d8d1c51a attempted fix a bug in binary matching, but it only
fixed the bug for the minimized test case.

This commit removes the previous fix and fixes the bug in a more
effective way. See the comments in the new code in `sys_core_bsm`
for an explanation.

This commit restores the optimizations in string.erl and dets_v9.erl
that the previous fix disabled.

I have not found any code where this commit will disable optimizations
when they are actually safe. There are some changes to the code
in ssl_cipher.erl in that some bs_start_match2 instruction did not
reuse the binary register for the match context, but the delayed
sub binary optimizations was never applied to the code in the first
place.

https://bugs.erlang.org/browse/ERL-689
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
2e40d8d1c51a attempted fix a bug in binary matching, but it only
fixed the bug for the minimized test case.

This commit removes the previous fix and fixes the bug in a more
effective way. See the comments in the new code in `sys_core_bsm`
for an explanation.

This commit restores the optimizations in string.erl and dets_v9.erl
that the previous fix disabled.

I have not found any code where this commit will disable optimizations
when they are actually safe. There are some changes to the code
in ssl_cipher.erl in that some bs_start_match2 instruction did not
reuse the binary register for the match context, but the delayed
sub binary optimizations was never applied to the code in the first
place.

https://bugs.erlang.org/browse/ERL-689
</pre>
</div>
</content>
</entry>
</feed>
