Richard Henderson - fix pr 29558 (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- From: Richard Henderson
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Feb 2007 08:19:49 -0800
- Subject: fix pr 29558
The pr highlights a big problem with the var tracking code on big-endian systems. Namely, the REG_OFFSET information can be wrong/useless after reload has got done flattening paradoxical subregs. Namely, what once was
(subreg:SI (reg:QI 101 temp+0) 0)
becomes (reg:SI 11 temp+-3)
First, a -3 offset into a data structure is pointless. But second, even if we took big-endian things into account to try and resolve that, we've lost information: namely, the amount of data actually present in that register. It does us no good to see (reg:SI 11 temp+12), and say that there are 4 bytes of temp in reg11, if in fact there is only one byte of temp present, and it's offset is actually +15.
None of which can be fixed for the 4.2 branch. But at least we can fix the crash. In this case we had a TImode array in memory, and the test for "structures and arrays" didn't trigger.
Fixed thus, tested ppc64.
r~
PR debug/29558
* var-tracking.c (track_expr_p): Disallow AGGREGATE_TYPE_P
in memory.
--- gcc/testsuite/gcc.dg/debug/pr29558.c (revision 122139) +++ gcc/testsuite/gcc.dg/debug/pr29558.c (local) @@ -0,0 +1,30 @@ +/* { dg-do compile } */ + +void stpi_unpack_16_1(int length, unsigned char *out, unsigned char bit) +{
- unsigned char tempin;
- unsigned char temp[16];
- for (bit = 128; length > 0; length--) {
- if (tempin & 128)
temp[0] |= bit;
- else
{
*out++ = temp[1];
*out++ = temp[2];
*out++ = temp[3];
*out++ = temp[4];
*out++ = temp[5];
*out++ = temp[6];
*out++ = temp[7];
*out++ = temp[9];
*out++ = temp[10];
*out++ = temp[11];
*out++ = temp[12];
*out++ = temp[13];
*out++ = temp[14];
*out++ = temp[15];
__builtin_memset (temp, 0, 16);
}
- } +}
- --- gcc/var-tracking.c (revision 122139) +++ gcc/var-tracking.c (local) @@ -1529,7 +1529,8 @@ track_expr_p (tree expr) if (MEM_P (decl_rtl)) { /* Do not track structures and arrays. */
if (GET_MODE (decl_rtl) == BLKmode)
if (GET_MODE (decl_rtl) == BLKmode
|| AGGREGATE_TYPE_P (TREE_TYPE (realdecl))) return 0; if (MEM_SIZE (decl_rtl) && INTVAL (MEM_SIZE (decl_rtl)) > MAX_VAR_PARTS)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |