This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimisation question


Hi!

I'm working on GTK code; let's say we have some code like:

widget->privData->color = ...;
widget->privData->l = ...;
widget->privData->w = ...;
widget->privData->foo = ...;

does gcc already optimise widget->privData saving its value one time and
than using it? or generated binary just does what is written(literally -
"reference per reference")?

Would it be better to do:
WidgetPrivData* priv = widget->privData;
priv->color = ...;
priv->l = ...;
priv->w = ...;
priv->foo = ...;
 ?

Thank you very much,
Riccardo
riccardo.lucchese@gmail.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]