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

Remove nothrow from doGNUABITagSemantic predicate function #15360

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Jun 27, 2023

The scope(failure) construct means that a try/catch statement is inserted into the function, this raises an error when params.useExceptions is disabled. This might look less than ideal, however counter-intuitively this change makes it possible to compile the whole front-end with -fno-exceptions.

So the good news is, we could mark every function in the front-end as nothrow and it'd successfully compile.

The downside is, that change requires hundreds-to-thousands of code changes everywhere at once.

I'd prefer to do the simplest thing for now and get -fno-exceptions working, then if someone finds the time to - or can automate - adding nothrow everywhere in the compiler, then all the better later.

@Geod24

@ibuclaw ibuclaw added GDC Gnu D Compiler Easy Review labels Jun 27, 2023
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15360"

@RazvanN7 RazvanN7 merged commit 5b5ce27 into dlang:master Jun 28, 2023
@ibuclaw ibuclaw deleted the rm_scope_failure branch June 28, 2023 07:50
nstester pushed a commit to nstester/gcc that referenced this pull request Jul 1, 2023
…no-exceptions'

The version flags for RTMI, RTTI, and exceptions was unconditionally
predefined.  These are now only predefined if the feature flag is
enabled.  It was noticed that there was no `-fexceptions' definition
inside d/lang.opt, so the detection of the exceptions option flag was
only partially working.  Once that was fixed, a few places in the
front-end implementation were found to fall fowl of `nothrow' rules,
these have been fixed upstream and backported here as well.

Reviewed-on: dlang/dmd#15357
	     dlang/dmd#15360

	PR d/110471

gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Predefine D_ModuleInfo,
	D_Exceptions, and D_TypeInfo only if feature is enabled.
	* lang.opt: Add -fexceptions.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr110471a.d: New test.
	* gdc.dg/pr110471b.d: New test.
	* gdc.dg/pr110471c.d: New test.
sebhub pushed a commit to RTEMS/gnu-mirror-gcc that referenced this pull request Jul 1, 2023
…no-exceptions'

The version flags for RTMI, RTTI, and exceptions was unconditionally
predefined.  These are now only predefined if the feature flag is
enabled.  It was noticed that there was no `-fexceptions' definition
inside d/lang.opt, so the detection of the exceptions option flag was
only partially working.  Once that was fixed, a few places in the
front-end implementation were found to fall fowl of `nothrow' rules,
these have been fixed upstream and backported here as well.

Reviewed-on: dlang/dmd#15357
	     dlang/dmd#15360

	PR d/110471

gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Predefine D_ModuleInfo,
	D_Exceptions, and D_TypeInfo only if feature is enabled.
	* lang.opt: Add -fexceptions.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr110471a.d: New test.
	* gdc.dg/pr110471b.d: New test.
	* gdc.dg/pr110471c.d: New test.

(cherry picked from commit da108c7)
rsh-raj pushed a commit to rsh-raj/gcc that referenced this pull request Oct 6, 2023
…no-exceptions'

The version flags for RTMI, RTTI, and exceptions was unconditionally
predefined.  These are now only predefined if the feature flag is
enabled.  It was noticed that there was no `-fexceptions' definition
inside d/lang.opt, so the detection of the exceptions option flag was
only partially working.  Once that was fixed, a few places in the
front-end implementation were found to fall fowl of `nothrow' rules,
these have been fixed upstream and backported here as well.

Reviewed-on: dlang/dmd#15357
	     dlang/dmd#15360

	PR d/110471

gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Predefine D_ModuleInfo,
	D_Exceptions, and D_TypeInfo only if feature is enabled.
	* lang.opt: Add -fexceptions.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr110471a.d: New test.
	* gdc.dg/pr110471b.d: New test.
	* gdc.dg/pr110471c.d: New test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Review GDC Gnu D Compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants