[amdgcn] Use frame pointer for CFA expressions.
authorHafiz Abid Qadeer <abidh@codesourcery.com>
Mon, 21 Jun 2021 21:47:58 +0000 (22:47 +0100)
committerHafiz Abid Qadeer <abidh@codesourcery.com>
Wed, 30 Jun 2021 16:48:30 +0000 (17:48 +0100)
commit22f201e4b32a4f8bc1e6462ee19643edae5d25a3
treefc345e9b3ac6473bf328af3ea4ca4d1a3992a83f
parent251697a64ba4d7f10f072702771a59d30364cc26
[amdgcn] Use frame pointer for CFA expressions.

As size of address is bigger than registers in amdgcn, we are forced to use
DW_CFA_def_cfa_expression to make an expression that concatenates multiple
registers for the value of the CFA.  This then prohibits us from using many
of the dwarf ops which expect CFA rule to be a single regsiter plus an offset.
Using frame pointer in the CFA rule is only real possibility as it is saved
in every frame and it is easy to unwind its value.

So unless user gives fomit-frame-pointer, we use frame pointer for the
cfi information.  This options also has a different default now.

gcc/

* common/config/gcn/gcn-common.c
(gcn_option_optimization_table): Change OPT_fomit_frame_pointer to -O3.
* config/gcn/gcn.c (gcn_expand_prologue): Prefer the frame pointer
when emitting CFI.
(gcn_expand_prologue): Prefer the frame pointer when emitting CFI.
(gcn_frame_pointer_rqd): New function.
(TARGET_FRAME_POINTER_REQUIRED): New hook.
gcc/common/config/gcn/gcn-common.c
gcc/config/gcn/gcn.c