Closed Bug 1329044 Opened 3 years ago Closed 3 years ago

Compiler bug in gcc <7.0 in TexUnpackSurface code (const auto& doesn't properly bind a scalar member of a temporary)

Categories

(Core :: Canvas: WebGL, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox51 --- fixed
firefox52 --- fixed
firefox53 --- fixed

People

(Reporter: kvark, Assigned: kvark)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file, 1 obsolete file)

> however, gcc versions earlier than 7 have a bug where this lifetime extension is not implemented for subobjects of scalar type: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54293

This applies to several cases in TexUnpackSurface implementation, like this one:
> const auto& rowLength = mSurf->GetSize().width;
Summary: Undefined behaviour with gcc6 in TexUnpackSurface code → Undefined behaviour with gcc <7.0 in TexUnpackSurface code
Summary: Undefined behaviour with gcc <7.0 in TexUnpackSurface code → Compiler bug in gcc <7.0 in TexUnpackSurface code (const auto& doesn't properly bind a member of a temporary)
Attached patch webgl-texunpackblob-ub.patch (obsolete) — Splinter Review
Assignee: nobody → kvark
Attachment #8824432 - Flags: review?(jgilbert)
Blocks: 1328357
need first a positive review before we can check this in
Keywords: checkin-needed
Flags: needinfo?(kvark)
Status: NEW → ASSIGNED
Flags: needinfo?(kvark)
Attachment #8824432 - Attachment is obsolete: true
Attachment #8824432 - Flags: review?(jgilbert)
Attachment #8825105 - Flags: review?(jgilbert) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d54ebcd1a796
Avoid taking const references to fields behind accessors. r=jgilbert
Keywords: checkin-needed
Comment on attachment 8825105 [details] [diff] [review]
Avoid taking const references to fields behind accessors.

Approval Request Comment
[Feature/Bug causing the regression]: 
[User impact if declined]: Incorrect behavior on GCC builds. (Linux)
[Is this code covered by automated tests?]:
[Has the fix been verified in Nightly?]:
[Needs manual test from QE? If yes, steps to reproduce]: 
[List of other uplifts needed for the feature/fix]:
[Is the change risky?]: No risk.
[Why is the change risky/not risky?]: Trivial change.
[String changes made/needed]: none
Attachment #8825105 - Flags: approval-mozilla-beta?
Attachment #8825105 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/d54ebcd1a796
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Comment on attachment 8825105 [details] [diff] [review]
Avoid taking const references to fields behind accessors.

workaround gcc bug affecting webgl, aurora52+, beta51+
Attachment #8825105 - Flags: approval-mozilla-beta?
Attachment #8825105 - Flags: approval-mozilla-beta+
Attachment #8825105 - Flags: approval-mozilla-aurora?
Attachment #8825105 - Flags: approval-mozilla-aurora+
Summary: Compiler bug in gcc <7.0 in TexUnpackSurface code (const auto& doesn't properly bind a member of a temporary) → Compiler bug in gcc <7.0 in TexUnpackSurface code (const auto& doesn't properly bind a scalar member of a temporary)
You need to log in before you can comment on or make changes to this bug.