Skip to content

[SR-8773] Regression in codegen for bounds-check-avoiding subscript? #51281

@stephentyrone

Description

@stephentyrone
Previous ID SR-8773
Radar None
Original Reporter @stephentyrone
Type Bug
Status Closed
Resolution Invalid
Additional Detail from JIRA
Votes 0
Component/s Compiler, Standard Library
Labels Bug, 5.0Regression, Performance
Assignee None
Priority Medium

md5: 1047d6cb8df254319d55fdb596cba74c

Issue Description:

@jepers asked a question about avoiding bounds checks in array subscripts: https://forums.swift.org/t/subscript-array-without-bounds-check/16222

His proposed solution .withUnsafeBufferPointer{ $0[i] } works on 4.1.2, but falls over rather dramatically on master. If this is not a deliberate semantic change, it appears to be a pretty severe optimization regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfperformanceregressionstandard libraryArea: Standard library umbrellaswift 5.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions