This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21407] [4.1 Regression] wrong code with upcast in C++
- From: "dberlin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2005 13:58:50 -0000
- Subject: [Bug tree-optimization/21407] [4.1 Regression] wrong code with upcast in C++
- References: <20050506002331.21407.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-05-09 13:58 -------
This is a call clobbering bug.
We don't pass the address of c to the call, we pass the address of some
substructure.
As a result, we don't think foo can touch c.b, when it can beause of the upcast.
Whee.
I'd imagine the following will fix it, though i haven't tested it yet
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.78
diff -u -p -r2.78 tree-ssa-operands.c
--- tree-ssa-operands.c 21 Apr 2005 18:05:26 -0000 2.78
+++ tree-ssa-operands.c 9 May 2005 13:57:44 -0000
@@ -1936,7 +1936,7 @@ note_addressable (tree var, stmt_ann_t s
Otherwise, we take the address of all the subvariables, plus the real
ones. */
- if (var && TREE_CODE (var) == COMPONENT_REF
+ if (0 && var && TREE_CODE (var) == COMPONENT_REF
&& (ref = okay_component_ref_for_subvars (var, &offset, &size)))
{
subvar_t sv;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21407