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] Make powerpc honor PROCESSOR_DEFAULT{,64} in tm*.h files


David discovered that there was a thinko in the logic of the powerpc setting
for the default tuning option.  In theory, the compiler was supposed to use
PROCESSOR_DEFAULT for 32-bit targets and PROCESSOR_DEFAULT64 for 64-bit targets
if no cpu or tuning option was used in configuring the compiler.  The current
linux64.h and aix61.h files set this to be power7.  However, the code actually
set the tuning to the default cpu used for code generation (powerpc and
powerpc64).

This patch for both 4.7 and 4.8 fixes the code so that the tm.h can set the
default as intended.  The person configuring the compiler can still use
--with-cpu=<xxx>, --with-tune=<xxx>, --with-cpu-32=<xxx>, --with-tune-32=<xxx>,
--with-cpu-64=<xxx> and --with-tune-64=<xxxx> to adjust the defaults to meet
local conditions.

I have bootstraped and ran make check with and without hte patches.  There are
no regressions with the patch, and one test now succeeds if power7 tuning is
used (64-bit gcc.dg/tree-prof/bb-reorg.c).  Is this ok to install?  David and I
think this is important to get into 4.7 rather than 4.7.1.

2012-03-07  Michael Meissner  <meissner@the-meissners.org>

	* config/rs6000/linux64.h (OPTION_TARGET_CPU_DEFAULT): Do not
	redefine to be NULL if the current bit-size is different from the
	configured bit-size.

	* config/rs6000/rs6000.c (rs6000_option_override_internal): If the
	cpu is defaulted, use PROCESSOR_DEFAULT and PROCESSOR_DEFAULT64 to
	set the default tuning.  Add asserts to make sure the cpu and tune
	indexes are defined.
	(rs6000_file_start): Do not reset the default cpu if the current
	bit-size is different from the configured bit-size.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com	fax +1 (978) 399-6899

Attachment: gcc-power7.patch327b
Description: Text document


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