From: Gabriel Dos Reis Date: Sun, 29 Feb 2004 17:59:25 +0000 (+0000) Subject: backport: re PR target/10904 (invalid (misaligned) FP register at -O2) X-Git-Tag: releases/gcc-3.3.4~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=320a304e12bfc2cbbc9f64a40168c6dedcf49a63;p=thirdparty%2Fgcc.git backport: re PR target/10904 (invalid (misaligned) FP register at -O2) Backport from mainline: 2004-01-27 Eric Botcazou PR target/10904 PR target/13058 * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New. Forbid mode changes from SImode for lower FP regs if ARCH64. From-SVN: r78656 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index afe301a72807..78a3ce77d60a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-02-29 Gabriel Dos Reis + + Backport from mainline: + 2004-01-27 Eric Botcazou + PR target/10904 + PR target/13058 + * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New. + Forbid mode changes from SImode for lower FP regs if ARCH64. + 2004-02-28 John David Anglin * pa.h (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE, TRAMPOLINE_CODE_SIZE, diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 5fe4fabb9c42..5706349cbeea 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1233,6 +1233,20 @@ enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS, {-1, -1, -1, 0x20}, /* GENERAL_OR_EXTRA_FP_REGS */ \ {-1, -1, -1, 0x3f}} /* ALL_REGS */ +/* Defines invalid mode changes. Borrowed from pa64-regs.h. + + SImode loads to floating-point registers are not zero-extended. + The definition for LOAD_EXTEND_OP specifies that integer loads + narrower than BITS_PER_WORD will be zero-extended. As a result, + we inhibit changes from SImode unless they are to a mode that is + identical in size. */ + +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + (TARGET_ARCH64 \ + && (FROM) == SImode \ + && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ + ? reg_classes_intersect_p (CLASS, FP_REGS) : 0) + /* The same information, inverted: Return the class number of the smallest class containing reg number REGNO. This could be a conditional expression