This is the mail archive of the gcc-bugs@gcc.gnu.org mailing 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]

[Bug tree-optimization/22486] Upcasts are not folded away


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-07-14 13:26 -------
Or even simple C:

typedef struct { int i; } Foo;
Foo foo;
Foo *bar(void) { return (Foo *)&foo.i; }

here, in bar() fold (or whoever) should fold (Foo *)&foo.i to &foo.
Because i is at offset zero and foo is of type Foo already.

I'm trying to teach fold_unary to do so, but maybe we won't ever see
the complete expression in fold.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22486


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