volatile const structure members in C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using m68k-elf-gcc with either revision 3.3.3 or 3.4.4, I compile the
following test program (as a C++ program) at -O2 to an object file:


struct sA { unsigned volatile const B;
            unsigned volatile       C;
            unsigned          const D;
            unsigned                E; };
void Function( sA & A ) { A.B; A.C; A.D; A.E; }


The object file I get looks like (edited for brevity):

	.globl	_Z8FunctionR2sA
	.type	_Z8FunctionR2sA, @function
_Z8FunctionR2sA:
	link.w %a6,#0
	move.l 8(%a6),%a0	| A, A
	move.l 4(%a0),%d0	| <variable>.C, <variable>.C
	unlk %a6
	rts

I was expecting that A.B and A.C would both generate loads since they are
both volatile, and that A.D and A.E would not, but only A.C loads.

Have I misunderstood how volatile const should work, or is this a bug I
should submit?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux