Confusion with labels as values

2019-06-19 Thread Florian Rommel
Hi, Recently I wanted to take and print the address of a label. When compiling with -O2, I noticed that the address equals the function body start address if the label is not used as a goto target. Here is an example: #include int main(void) { printf("main: %p\n", main); printf("labe

Re: Static sem_item_optimizer instance in ipa-icf pass

2018-08-16 Thread Florian Rommel
Hi Martin, That can definitely done better, if I see correctly only reference from sem_item, sem_function and sem_variable is in sem_item::add_type. That can be removed. Yes, only sem_item::add_type uses this variable. Do you think the whole static optimizer variable should be removed?

Static sem_item_optimizer instance in ipa-icf pass

2018-08-01 Thread Florian Rommel
Hi, I stumbled across this during my work on a gcc compiler plugin [1]. During the ipa-icf pass semantic items (`sem_function` and `sem_variable`) are generated to find potential candidates for function or variable merging. In `ipa-icf.c` there is a static variable `optimizer` (of type `sem