This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Don't assume that a landing pad exists in setMustKeepGlobalVariables
AbandonedPublic

Authored by mstorsjo on Oct 3 2016, 2:02 AM.

Details

Summary

This fixes crashes (PR30535) when building C++ code (with exceptions enabled) for ARM/Windows with optimizations enabled.

Diff Detail

Event Timeline

mstorsjo updated this revision to Diff 73246.Oct 3 2016, 2:02 AM
mstorsjo retitled this revision from to [CodeGen] Don't assume that a landing pad exists in setMustKeepGlobalVariables.
mstorsjo updated this object.
mstorsjo added a reviewer: qcolombet.
mstorsjo added a subscriber: llvm-commits.

Ping @qcolombet or anyone else familiar with GlobalMerge.cpp.

hans added a subscriber: hans.

+majnemer who knows about these things.

mstorsjo: Please turn the IR reproducer on the PR into a test case and add to the patch.

mstorsjo updated this revision to Diff 73692.Oct 5 2016, 1:46 PM

Added a test based on the pretty minimal IR that shows the issue.

majnemer added inline comments.Oct 5 2016, 2:01 PM
lib/CodeGen/GlobalMerge.cpp
513–521

This seems wrong. We should add cases for catchswitch & cleanuppad.

mstorsjo abandoned this revision.Oct 27 2016, 1:55 PM

This seems to have been fixed differently in SVN r284633.