This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] no lowering of &a.b (and &a->b) in the C front-end
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Aug 2004 00:08:35 +0000 (UTC)
- Subject: Re: [PATCH] no lowering of &a.b (and &a->b) in the C front-end
- References: <AAD1EF8A-F496-11D8-95FD-00039351ED8A@physics.uc.edu>
On Sun, 22 Aug 2004, Andrew Pinski wrote:
> I found that both the C and C++ front-ends do lower &a.b into a +
> offsetof(b,a)
> which is really not good for some optimizations which can change the struct
> a into scaler values.
Anything susceptible to a testcase (i.e. one failing before this patch and
passing afterwards)?
> @@ -2538,9 +2538,14 @@ build_unary_op (enum tree_code code, tre
> addr = fold (build2 (PLUS_EXPR, argtype,
> convert (argtype, addr),
> convert (argtype, byte_position (field))));
> + + addr2 = build1 (ADDR_EXPR, argtype, arg);
> + + if (!TREE_CONSTANT (addr) || TREE_CONSTANT (addr2))
There looks to be something odd about this "+ +" in the patch.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)