chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#1665: Inlining issue


From: Chicken Trac
Subject: #1665: Inlining issue
Date: Wed, 22 Jan 2020 06:59:34 -0000

#1665: Inlining issue
-------------------------------+------------------------------
            Reporter:  megane  |       Type:  defect
              Status:  new     |   Priority:  major
           Milestone:  5.2     |  Component:  compiler
             Version:  5.1.0   |   Keywords:  inline optimizer
Estimated difficulty:          |
-------------------------------+------------------------------
 Same issue with C4.
 {{{
 ::::::::::::::
 mod.scm
 ::::::::::::::
 (module
  mod
  (bar)
  (import scheme)

  (define (bar x y) (display x y))

  )
 ::::::::::::::
 main.scm
 ::::::::::::::
 (module main () (import scheme mod)
         (define foo
           (lambda [x]
             (lambda (a)
               (if a
                   (bar x 'xxx)
                   (if x
                       (bar x 'yyy)
                       (bar x 'zzz)))
               1)))

         (foo 'yo)
         (foo 'yo2)
         )
 ::::::::::::::
 run.sh
 ::::::::::::::
 #!/usr/bin/env bash
 set -euo pipefail

 rm -f *.o *.c *.inline *.import.*

 csc -c mod.scm -J -unit mod -oi mod.inline

 csc -inline-global main.scm -uses mod mod.o

 # $ ./run.sh
 # main.c: In function ‘f_251’:
 # main.c:261:1: warning: implicit declaration of function ‘f_230’; did you
 mean ‘f_238’? [-Wimplicit-function-declaration]
 #  f_230(4,av2);}}}}
 #  ^~~~~
 #  f_238
 # main.c:261:1: warning: ‘noreturn’ function does return
 #  f_230(4,av2);}}}}
 #  ^~~~~
 # main.o: In function `f_251':
 # main.c:(.text+0x8ee): undefined reference to `f_230'
 # collect2: error: ld returned 1 exit status
 }}}

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1665>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]