Unable to access variable name corresponding to register RTX in gcc

63 views Asked by At

Is it possible to access the variable name if we have an RTX which is a reg that corresponds to a variable declared by the user in GCC?

I have found the macro REG_USERVAR_P (RTX) in rtl.h which returns the boolean "1 if RTX is a reg that corresponds to a variable declared by the user." But I am unable to get a suitable macro to get the variable name the reg corresponds to.

On dumping the rtl output using the command

print_rtl_single(stdout, in_rtx);

I get output:

(reg/v:SI 68 [ c ])

where c was the variable name defined by me. How do I access c given the rtx statement, in_rtx?

1

There are 1 answers

0
yflelion On

To access the c in your example usethe command:

if (REG_EXPR(in_rtx))
  print_mem_expr (stdout, REG_EXPR (in_rtx));