Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function call used instead of primitive arithmetic operation #1

Open
GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

compile a module with content

module A where

g :: Int -> Int
g x = x * 5

inspecting produced file A.c

Int f_A (Int x_2) {
    return _sym_622_Prelude/* * */(x_2, 5);
}

compile a second module 

module B where 

f :: Int -> Int
f x = x * 5

g :: Int -> Int
g x = f (x +1)

inspecting the produced file B.c

Int f_B (Int x_3) {
    return _sym_622_Prelude/* * */(x_3, 5);
}
Int g_B (Int x_4) {
    return ((x_4 + 1) * 5);
}

What is the expected output? What do you see instead?

primitive integer multiplication is used in the second module but not in the 
first. 

What version of the product are you using? On what operating system?
HEAD from https://code.google.com/p/timberc/

Original issue reported on code.google.com by [email protected] on 20 Oct 2012 at 11:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant