bugGforth - Bugs: bug #63201, compilation: [ 1 ]L cells + =>...

 
 

bug #63201: compilation: [ 1 ]L cells + => #8 +

Submitter:  Stephan Rudlof <hartrock>
Submitted:  Tue 11 Oct 2022 04:53:01 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  anton
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Oct 2022 12:35:23 AM UTC, comment #2: 

comment #1:

> This is not a bug, but a feature.  Our (relatively recent) constant folder evaluates "1 cells" at compile time to 8.

This makes sense (and is good!).

(Very) wrongly thought (after simplifying a more complicated expression), that both expressions should give the same result. Sorry for the confusion (too tired in the night).

>...

Stephan Rudlof <hartrock>
Tue 11 Oct 2022 09:26:45 PM UTC, comment #1: 

This is not a bug, but a feature.  Our (relatively recent) constant folder evaluates "1 cells" at compile time to 8.  I dimly remember that the documentation recommends discusses the pre-optimization behaviour.  If so, the documentation has to be updated.

Anton Ertl <anton>
Group administrator
Tue 11 Oct 2022 04:53:01 PM UTC, original submission:  


sr@rs:~/Gforth$ cat br_literal.fs
: t1
    cells [ 1 ]L +
;
: t2
    [ 1 ]L cells +
;
sr@rs:~/Gforth$ gforth br_literal.fs
Gforth 0.7.9_20221006
Authors: Anton Ertl, Bernd Paysan, Jens Wilke et al., for more type `authors'
Copyright © 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `help' for basic help
see t1
: t1
  cells #1 + ; ok
see t2
: t2
  #8 + ; ok
2 t1 . 17  ok
2 t2 . 10  ok

sr@rs:~/Gforth$

Would expect:

: t2
  #1 cells + ;


Stephan Rudlof <hartrock>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by paysan (Updated the item)
  • -email is unavailable- added by anton (Posted a comment)
  • -email is unavailable- added by hartrock (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-21 paysan Open/ClosedOpen Closed
    2022-10-11 anton StatusNone Confirmed
        Assigned toNone anton

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code