This is the mail archive of the
mailing list for the GCC project.
Re: Adding constants to LO_SUM
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Subject: Re: Adding constants to LO_SUM
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 09 Jul 2001 10:23:43 -0700
- CC: gcc-patches at gcc dot gnu dot org
- References: <10107091626.AA05718@vlsi1.ultra.nyu.edu>
email@example.com (Richard Kenner) writes:
> the patch http://gcc.gnu.org/ml/gcc-patches/2001-07/msg00166.html
> essentially make plus_constant_wide transform expressions of the form
> lo_sum(a,b)+c to lo_sum(a,b+c). I think this is incorrect
> Yes, that is indeed incorrect, but plus_constant_for_output was added to do
> precisely that in 1990 by Michael Tiemann.
> Does anybody understand what's going on here? How was this ever correct?
plus_constant_for_output is used in the rs6000 backend to do accesses
of 64-bit values in 32-bit mode (to get to the second word). I think
it just happens to work here, because on rs6000 64-bit values are
usually 64-bit aligned, so the problematic case won't occur. All the
other places it is used in generic code, the result is not output.
I would propose putting a big warning message above it, explaining
that using it requires machine-specific information about how LO_SUM
works and about alignment.
- Geoffrey Keating <firstname.lastname@example.org>