#119 ✓resolved
Peter Johnson

preprocessor does not cull symbols in expressions when possible

Reported by Peter Johnson | June 25th, 2011 @ 07:50 PM

Originally posted on Trac by vapier@gentoo.org
Original Trac Ticket

  Description

i came across a package doing this:

extern RW
%define RW.thm (RW + 22032)
%define RW.en  (RW + 23056)
segment .text
movd [eax + RW.thm - RW.en], mm2

in theory, this value is calculable ... even though RW is an undefined external symbol, its value will be static which means you should be able to do (RW - RW) and get 0. or in this case, the break down is arithmetically obvious:

.. = RW.thm - RW.en
.. = (RW + 22032) - (RW + 23056)
.. = 22032 - 23056
.. = -1024

Trac Attachments

h3. Trac Comments
comment:1

              Changed 4 years ago by peter


(In [2018]) Fix #124: Fully simplify out sym-sym in values (e.g. a symbol minus itself).
This could particularly cause false errors if sym is external.

      comment:1

                  Changed 4 years ago by peter

      Status
        changed from new to closed
    
      Resolution
        set to fixed

(In [2018]) Fix #124: Fully simplify out sym-sym in values (e.g. a symbol minus itself).
This could particularly cause false errors if sym is external.

      Status
        changed from new to closed
    
      Resolution
        set to fixed

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket

Pages