#178116 - asoggytoaster - Mon Oct 28, 2013 2:56 am
I'm not sure how many people are still around to view this and provide input but I thought I'd post it anyway. Now, I know that this isn't the optimal way of doing this, but http://pastebin.com/YagHSBkM in that code snippet, I created a struct with bit-fields to access the various values of the display control register at 4000000h.
I don't have a problem with bit juggling,I have a macro display_set_mode() that will set the register value without using the bitfields, instead it relies on the .raw member of the struct. but, to the point..
If you look carefully at the assembly generated by the compiler, you'll notice that lines 64-65 of the paste are consistent with line 56. Then lines 66-69 are consistent with line 58. The compiler optimized line 57 out of existence, which in this instance is kinda bad because line 57 sets the display mode.
Now, when optimization is completely disabled, the compiler will generate code that functions as expected. But, when any optimization is turned on at all, line 57 disappears. Has anyone seen anything like this before?
Last edited by asoggytoaster on Mon Oct 28, 2013 5:05 am; edited 1 time in total
I don't have a problem with bit juggling,I have a macro display_set_mode() that will set the register value without using the bitfields, instead it relies on the .raw member of the struct. but, to the point..
If you look carefully at the assembly generated by the compiler, you'll notice that lines 64-65 of the paste are consistent with line 56. Then lines 66-69 are consistent with line 58. The compiler optimized line 57 out of existence, which in this instance is kinda bad because line 57 sets the display mode.
Now, when optimization is completely disabled, the compiler will generate code that functions as expected. But, when any optimization is turned on at all, line 57 disappears. Has anyone seen anything like this before?
Last edited by asoggytoaster on Mon Oct 28, 2013 5:05 am; edited 1 time in total