Skip to content
Snippets Groups Projects

Work around a nasty compiler bug in GCC 6.3

Merged Steffen Müthing requested to merge bug/workaround-for-gcc-6-3-bug-in-bitsetvector into master
1 unresolved thread

GCC 6.3 errors out with an ICE or simply hangs when instantiating a certain variant of operator^= on BitSetVectorReference. This patch works around the problem by forcing the actual XOR instruction into a separate function for that compiler. The workaround is probably horribly slow, but it shouldn't have any impact on unaffected compilers.

This probably needs backporting.

Edited by Steffen Müthing

Merge request reports

Pipeline #10264 passed

Pipeline passed for 528b5f36 on bug/workaround-for-gcc-6-3-bug-in-bitsetvector

Approval is optional

Merged by Steffen MüthingSteffen Müthing 6 years ago (Jun 29, 2018 12:45pm UTC)

Merge details

  • Changes merged into with 9a9fceea.
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #10265 passed

Pipeline passed for 9a9fceea on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
315 315 return *this;
316 316 }
317 317
318 private:
319
320 // For some reason, the following variant of operator^= triggers an ICE or a hanging
321 // compiler on Debian 9 with GCC 6.3 and full optimizations enabled (-O3).
322 // The only way to reliably avoid the issue is by making sure that the compiler does not
323 // see the XOR in the context of the function, so here is a little helper that will normally
324 // be inlined, but not on the broken compiler. This incurs a substantial overhead (a function
325 // call), but until someone else has a better idea, it's the only way to make it work reliably.
Please register or sign in to reply
Loading