Skip to content

lfortran_intrinsics do not work with --fast #1698

Closed
@gptsarthak

Description

@gptsarthak

Currently any of the functions/imports that use the lfortran_intrinsics architecture do not work with the --fast option.
Functions that are supposed to return integer/float values, return 0 or garbage values.

For example:

import time
import random
import math

print(time.time())
print(random.randrange(10,20))
print(random.random())
print(math.atanh(0.90))
(lp) sarthak@pop-os:~/lpython$ lpython examples/time.py
1.68124988955907702e+09
13
3.94382926819093038e-01
1.47221948958322035e+00
(lp) sarthak@pop-os:~/lpython$ lpython --fast examples/time.py
0.00000000000000000e+00
0
9.53282412436823800e-130
9.53282412436823800e-130

Update : The issue is somewhere in inline_function_calls pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions