This is the mail archive of the gcc-patches@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]

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


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.

Attachment: temp.diff.txt
Description: Text document


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