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] |
- From: Alexandre Oliva
- To: Grigory Zagorodnev <grigory_zagorodnev at linux dot intel dot com>
- Cc: Richard Guenther , gcc-patches at gcc dot gnu dot org, jakub at redhat dot com
- Date: Sat, 17 Feb 2007 05:10:24 -0200
- Subject: Re: SRA and inconsistencies in bit-field types
- References: <or1wku4yo1.fsf@free.oliva.athome.lsd.ic.unicamp.br> <84fc9c000702130127h1ea6f9fu9558b41253306d78@mail.gmail.com> <ory7n0ujsu.fsf@free.oliva.athome.lsd.ic.unicamp.br> <84fc9c000702150146s40391b60u24044433c39bea61@mail.gmail.com> <ory7mzqpau.fsf@free.oliva.athome.lsd.ic.unicamp.br> <45D5C7A5.2@linux.intel.com>
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
- 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
return build2 (MODIFY_EXPR, void_type_node, dst, src); }efficiently, but that's only introduced in GCC 4.3. */
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}
- References:
- SRA and inconsistencies in bit-field types
* From: Alexandre Oliva - Re: SRA and inconsistencies in bit-field types
* From: Richard Guenther - Re: SRA and inconsistencies in bit-field types
* From: Alexandre Oliva - Re: SRA and inconsistencies in bit-field types
* From: Richard Guenther - Re: SRA and inconsistencies in bit-field types
* From: Alexandre Oliva - Re: SRA and inconsistencies in bit-field types
* From: Grigory Zagorodnev
- SRA and inconsistencies in bit-field types
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |