This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fix powerpc 64 alignment problem for lwa instruction
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: hm dot chang at apple dot com (Hui-May Chang)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Nov 2006 15:56:24 -0500 (EST)
- Subject: Re: [patch] Fix powerpc 64 alignment problem for lwa instruction
> We, at Apple, found a ppc64 code generation problem where lwa_operand
> routine didn't check the alignment of a memory operand being 32 bits
> aligned or not.
> The following patch has been tested on ppc MacOS with "make all", "--
> enable-languages=c,c++,objc,obj-c++", and regression tested with a top-
> level "make check-gcc" with no regression.
> * gcc/config/rs6000/predicates.md (lwa_operand): Check the alignment of
> a memory operand is 32 bits aligned or not.
This is the wrong fix, the memory alignment is not the issue here but the offset
field has to be multiple of 4. This is according to the ISA documents.
Can you give more information about what is going wrong? Because as far as I can
tell we check the offset to make sure it is a multiple of 4.
|| GET_CODE (XEXP (XEXP (inner, 0), 1)) != CONST_INT
|| INTVAL (XEXP (XEXP (inner, 0), 1)) % 4 == 0));