[PATCH] Fix target/19334, a CONST_DECL is placed in the wrong section on darwin

Andrew Pinski pinskia@physics.uc.edu
Sun Jan 9 20:06:00 GMT 2005


With this short fortran testcase and -fmerge-constants:
       call c_i1(0_1)
       end

We get the const decl in the wrong section, we get it in .literal8 which
is wrong as the size of the decl is one byte.  The problem is that 
TYPE_SIZE
is the size in bits and not in bytes.  This patch fixes the problem by
multiplying BITS_PER_UNIT when checking TYPE_SIZE.

OK? Bootstrapped and tested on powerpc-darwin and fixes
gfortran.dg/g77/f90-intrinsic-bit.f testcase which shows the same
problem.

Thanks,
Andrew Pinski

ChangeLog:

	* config/darwin.c (machopic_select_section): Multiply by
	BITS_PER_UNIT to get the correct size.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: temp.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050109/d5953e08/attachment.txt>


More information about the Gcc-patches mailing list