From 6176e8accbb37f376070b92cdc70e9fe2b11f0f9 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Mon, 25 Feb 2013 16:56:30 +0100 Subject: Clean up and homogenize text messages for options --- lib/hipe/main/hipe.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/hipe/main/hipe.erl b/lib/hipe/main/hipe.erl index b2789978a4..6e00b13292 100644 --- a/lib/hipe/main/hipe.erl +++ b/lib/hipe/main/hipe.erl @@ -1135,7 +1135,7 @@ option_text(debug) -> option_text(icode_range) -> "Performs integer range analysis on the Icode level"; option_text(icode_ssa_check) -> - "Checks whether Icode is on SSA form or not\n"; + "Checks whether Icode is on SSA form or not"; option_text(icode_ssa_copy_prop) -> "Performs copy propagation on Icode SSA"; option_text(icode_ssa_const_prop) -> @@ -1143,14 +1143,14 @@ option_text(icode_ssa_const_prop) -> option_text(icode_ssa_struct_reuse) -> "Factors out common tuple and list constructions on Icode SSA"; option_text(icode_type) -> - "Performs type analysis on the Icode level" ++ + "Performs type analysis on the Icode level\n" ++ "and then simplifies the code based on the results of this analysis"; option_text(load) -> "Automatically load the produced native code into memory"; option_text(peephole) -> "Enables peephole optimizations"; option_text(pmatch) -> - "Enables pattern matching compilation when compiling from Core; " ++ + "Enables pattern matching compilation when compiling from Core;\n" ++ "has no effect when compiling from BEAM bytecode"; option_text(pp_asm) -> "Displays assembly listing with addresses and bytecode\n" ++ @@ -1197,11 +1197,11 @@ option_text(timeout) -> " The limit must be a non-negative integer or the atom 'infinity'.\n" ++ " The current default limit is 15 minutes (900000 ms)."; option_text(use_indexing) -> - "Use indexing for multiple-choice branch selection."; + "Use indexing for multiple-choice branch selection"; option_text(use_callgraph) -> - "Compile the functions in a module according to a reversed topological " ++ - "sorted order to gain more information when using a persistent lookup " ++ - "table for storing intra-modular type information."; + "Compile the functions in a module according to a reversed topological\n" ++ + "sorted order to gain more information when using a persistent lookup\n" ++ + "table for storing intra-modular type information"; option_text(verbose) -> "Output information about what is being done"; option_text(Opt) when is_atom(Opt) -> -- cgit v1.2.3 From 6907ed77452dcf409e0e3540cf7bd876e87b54b9 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Mon, 25 Feb 2013 16:56:58 +0100 Subject: Fix bug related to the handling of is_number/1 by the range analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following module produced erroneous results when compiled with HiPE: -module(a). -export([foo/1]). foo(X) when is_number(X) -> is_integer(X). Running: 1> c(a). 2> a:foo(0). true 3> hipe:c(a). 4> a:foo(0). false % *** WRONG *** The problem was that the 'number' case for the `hipe_icode:type_test/1` was going to the default case where the argument was determined as being something other than an integer. Thanks to Sebastian Egner and Johannes Weißl for bringing the bug into attention. Fixed on the day it was reported. --- lib/hipe/icode/hipe_icode_range.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl index c222e8a5d5..46c5a39f2c 100644 --- a/lib/hipe/icode/hipe_icode_range.erl +++ b/lib/hipe/icode/hipe_icode_range.erl @@ -784,6 +784,8 @@ analyse_type(Type, Info, Rewrite) -> integer -> TrueRange = inf(any_range(), OldVarRange), FalseRange = inf(none_range(), OldVarRange); + number -> + TrueRange = FalseRange = OldVarRange; _ -> TrueRange = inf(none_range(), OldVarRange), FalseRange = OldVarRange -- cgit v1.2.3