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

[dmd-cxx] Remove redundant contract checking #11623

Merged
merged 1 commit into from Aug 25, 2020

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Aug 25, 2020

  • Removes prelude assert for constructors and destructors.
  • Disables bounds checking in foreach statements (fixes Issue 15581)

Just a small optimization, but something stumbled across when was looking into reducing a x86_64 dwarf/tls bug (and converting the generated code into C++ to see if could be reproducible in other front-ends).

- Removes prelude assert for constructors and destructors.
- Disables bounds checking in foreach statements (fixes Issue 15581)
@ibuclaw ibuclaw added GDC Gnu D Compiler C++ Port labels Aug 25, 2020
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
15581 enhancement foreach should avoid bounds checking

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 "dmd-cxx + dmd#11623"

@dlang-bot dlang-bot merged commit f6c229d into dlang:dmd-cxx Aug 25, 2020
@ibuclaw ibuclaw deleted the dmd-cxx-contracts branch August 25, 2020 13:03
kraj pushed a commit to kraj/gcc that referenced this pull request Aug 26, 2020
1. Removes prelude assert for constructors and destructors.  To trigger
these asserts one needed to construct or destruct an aggregate at the
null memory location.  This would crash upon any data member access,
which is required for a constructor or destructor to do anything useful.

2. Disables bounds checking in foreach statements, when the array is
either a static or dynamic array.  If we trust the array `.length' to
be correct, then all elements are between `[0 .. length]', and can't
can't be out of bounds.

Reviewed-on: dlang/dmd#11623

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd e49192807
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants