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]

Re: Flags -g and -O give very different results


Any pointers for how to track this sort of thing down? What kind of things should I look for?

Mostly casts from one pointer type to another (you probably can ignore void* and char* though).

Things like

long f(int *x) {
	return *(long *)x;
}

are the most common problems. So,

*(<some type> *)<some data address>

[there are more subtle things as well -- but almost all of the
time, the problem is gross implicit violation of the C99 data
aliasing rules).


Segher



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