Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove -Os option for gcc, it breaks TRUENAME check for JOIN/SUBST/AS…
…SIGNed drives
- Loading branch information
3754daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should report this to @tkchia , it seems very odd.
3754daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to, but wanted to see if I could make a minimal test case first.
3754daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @PerditionC, hello @andrewbird,
The problem is in the
label.c
code — in fact the same problem might potentially crop up in the Watcom port as well. Inthe
segread (·)
call may not setsregs.es
to point to the program's data segment. This is because the ABI (whether undergcc-ia16
or Open Watcom) does not guarantee thees
register to have any particular value at that point. And we need to set bothsregs.ds
andsregs.es
properly for thetruename
syscall.So you probably want to do something like
(Personally I would prefer to use
FP_SEG
andFP_OFF
to initializesregs.ds
,sregs.es
,regs.x.si
andregs.x.di
. That though is just a matter of style.)Thank you!
3754daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @PerditionC,
Anyway, I would not recommend removing all optimization options for GCC. The default is no optimization (
-O0
), which results in extremely dumb code.Thank you!
3754daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I did a quick read over the code and saw es was being read (segread), but forgot to consider es not being valid itself, should have known given the comment about needing small or tiny model which is a good indicator segments handling may not be right in all settings. Andrew has already submitted a patch with the suggested fix so I will test and commit it after I get up. Thank you both.