This is the mail archive of the gcc-patches@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]

Re: [PATCH, middle-end]: Fix PR middle-end/32374


On Tue, Jun 19, 2007 at 01:43:42PM +0200, Uros Bizjak wrote:

> A clobber is not needed for a memory, as in the next insn we write
> something to this address. As pointed out by Rask [1], this clobber is
> needed in case of subregs of pseudo registers, wider than
> BITS_PER_WORD.

   Jan Hubicka says something similiar about (clobber (mem ))
<URL:http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01310.html>.

> Index: testsuite/gcc.dg/pr32374.c
> ===================================================================
> --- testsuite/gcc.dg/pr32374.c  (revision 0)
> +++ testsuite/gcc.dg/pr32374.c  (revision 0)
> @@ -0,0 +1,19 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2" } */
> +
> +typedef long unsigned int size_t;

   Where do you use size_t?

> Index: expr.c
> ===================================================================
> --- expr.c      (revision 125846)
> +++ expr.c      (working copy)
> @@ -5062,7 +5062,7 @@ store_constructor (tree exp, rtx target,
>            cleared = 1;
>          }
> 
> -       if (! cleared)
> +       if (REG_P (target) && (! cleared))
>          emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
> 
>        /* Store each element of the constructor into the

   I'd have used !MEM_P (target) instead of REG_P (target), but that's only
because I've been burned a few [cough] times by testing REG_P (x) when I
should've tested register_operand (x) or !MEM_P (x) (so as to catch
subregs). I can't think of any useful (clobber (subreg)) example, and we
don't want to emit (clobber (const_int)) and such, so I think it is ok the
way it is.

-- 
Rask Ingemann Lambertsen


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