Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression #20777: wrong line numbers diagnosed in inline asm #20982

Closed
ibuclaw opened this issue Mar 13, 2025 · 3 comments
Closed

Regression #20777: wrong line numbers diagnosed in inline asm #20982

ibuclaw opened this issue Mar 13, 2025 · 3 comments
Labels
Compiler:GDC Gnu D Compiler Severity:Regression PRs that fix regressions

Comments

@ibuclaw
Copy link
Member

ibuclaw commented Mar 13, 2025

Example:

module asm1;



// Gap intentional



void main()
{
    asm { "" [; }
}

Reports:

asm1.d(1): Error: expression expected, not `;`
module asm1;
^
asm1.d(1): Error: found `End of File` when expecting `,`
module asm1;
 ^
asm1.d(1): Error: found `End of File` when expecting `]`
module asm1;
 ^
asm1.d(1): Error: found `End of File` when expecting `;`
module asm1;
 ^

Introduced by #20777

@ibuclaw ibuclaw added Compiler:GDC Gnu D Compiler Severity:Regression PRs that fix regressions labels Mar 13, 2025
@dkorpel
Copy link
Contributor

dkorpel commented Mar 13, 2025

Do you have a test case for dmd?

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 13, 2025

Do you have a test case for dmd?

Not without adding a call to gccAsmSemantic in dmd's branch for asm semantic.

Looking at the change, I suspect it might be a new requirement to fix up the starting line?

https://github.com/dlang/dmd/pull/20777/files#diff-862192b33df815981dcb4a8a49bc7dc572506b444a7dc034fde3643f887e2982R5931

@dkorpel
Copy link
Contributor

dkorpel commented Mar 13, 2025

Yes, gccAsmSemantic does p.scanloc = s.loc; which doesn't work anymore. I'll see if I can unittest that function.

dkorpel added a commit to dkorpel/dmd that referenced this issue Mar 14, 2025
dkorpel added a commit to dkorpel/dmd that referenced this issue Mar 14, 2025
@ibuclaw ibuclaw closed this as completed Mar 17, 2025
dkorpel added a commit that referenced this issue Mar 21, 2025
* bump VERSION to v2.110.0

* purge changelog

* bump VERSION to v2.111.0-beta.1

* Accept __rvalue attribute on ref functions; which will force the result to be treated as __rvalue. (#20946)

This is essential to implement `move`, `forward`, etc.

* memoryerror.d: Fix AnySupported version condition (#20983)

* Fix #20982 - wrong line number in iasmgcc (#20993)

* Move genCfunc to cxxfrontend (#20992)

* druntime: Fix compilation of rt.cover on Android (#21015)

* Expose SourceLoc to C++ interface (#20980)

* [stable] C++ header fixes for declaration, expression, and typinf (#21016)

Seen either from compilation errors or missing symbols at link time.

* C++ headers: Add 3 Declaration bitfield setters/getters required by LDC

* druntime: Add module declaration to rt.invariant, to prevent conflicts with user-provided invariant.d (#21017)

* Fix #21020 - Indexing a *cast* AA yields no lvalue anymore (#21029)

* Add C++23 to CppStdRevision enum (#21043)

* Improve UFCS/property error message (#21046)

---------

Co-authored-by: Manu Evans <turkeyman@gmail.com>
Co-authored-by: Martin Kinkelin <kinke@users.noreply.github.com>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler:GDC Gnu D Compiler Severity:Regression PRs that fix regressions
Projects
None yet
Development

No branches or pull requests

2 participants