Alexandre Oliva - Re: SRA and inconsistencies in bit-field types (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]

On Feb 16, 2007, Grigory Zagorodnev grigory_zagorodnev@linux.intel.com wrote:

Alexandre Oliva wrote:

How about enclosing the gcc_assert in #ifdef ENABLE_CHECKING in the 4.1 and 4.2 branches? (I'm going to test the 4.2 branch now)

That's also fine.

4.2 testing completed, so this is what I've installed in the branches (4.1 and 4.2, respectively):

Alexandre, it appears that this patch caused cpu2006/povray compilation failure.

As it turns out, the absence of TYPE_CANONICAL in older branches wasn't that easy to overcome. I could have done it (there's code elsewhere that performs similar type checks), but I didn't think it was worth it. The assertion was intended to detect inconsistencies that were already present before anyway, so it's not like we lose anything taking it out.

Here's what I've installed the following patches in 4.2 and 4.1, respectively, to fix this problem. Sorry that my testing didn't catch it.

Index: gcc/ChangeLog from Alexandre Oliva aoliva@redhat.com

PR tree-optimization/30823
* tree-sra.c (sra_build_assignment): Drop type-checking assert.

Index: gcc/tree-sra.c

--- gcc/tree-sra.c (revision 122069) +++ gcc/tree-sra.c (working copy) @@ -1656,10 +1656,8 @@ static tree sra_build_assignment (tree dst, tree src) { -#ifdef ENABLE_CHECKING

-#endif

Index: gcc/ChangeLog from Alexandre Oliva aoliva@redhat.com

PR tree-optimization/30823
* tree-sra.c (sra_build_assignment): Drop type-checking assert.

Index: gcc/tree-sra.c

--- gcc/tree-sra.c (revision 122069) +++ gcc/tree-sra.c (working copy) @@ -1558,10 +1558,8 @@ static tree sra_build_assignment (tree dst, tree src) { -#ifdef ENABLE_CHECKING - gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (dst)) - == TYPE_MAIN_VARIANT (TREE_TYPE (src))); -#endif + /* We need TYPE_CANONICAL to compare the types of dst and src + efficiently, but that's only introduced in GCC 4.3. */ return build (MODIFY_EXPR, void_type_node, dst, src); }

Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/ FSF Latin America Board Member http://www.fsfla.org/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}


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