This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: More inline arm assembly woes... (long)


> While I like the array access optimization, I'm appalled by the fact that 
> gcc seems to have optimized the addition out of existence.  Anyone have any 
> ideas here?

The final (post-addition) value of result wasn't used anywhere.  Under
optimization, gcc will remove calculation of values it doesn't need.
You could declare result "volatile" to prevent gcc from doing this (and
other optimizations) on that variable, or you could use result later on
in the code.

As for being told this is happening, -Wunused-value should cause a warning
each time gcc encounters a value it deems eligible for such removal.  I'm
pretty sure that's included in -Wall, also.


                              Carl Miller

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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