Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-12 Thread Qing Zhao
> On Jul 12, 2017, at 10:28 AM, David Miller wrote: > > From: Qing Zhao > Date: Wed, 12 Jul 2017 08:49:52 -0500 > >> and it also clearly mentioned that “specially aligned memory might >> use this constraint”. > > It guarantees the achieve the

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-12 Thread David Miller
From: Qing Zhao Date: Wed, 12 Jul 2017 08:49:52 -0500 > and it also clearly mentioned that “specially aligned memory might > use this constraint”. It guarantees the achieve the opposite of what you are trying to do. That is, it can be used to guarantee that something is

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-12 Thread Eric Botcazou
> Actually, My major question is whether the current handling of > special_memory_constraint in lra_constraints.c is correct or NOT based on > GCC internal documentation. I thought that’s independent from this > misaligned insns generation for M8, but looks I was wrong. The answer is yes, the

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread David Miller
From: Eric Botcazou Date: Wed, 12 Jul 2017 01:19:03 +0200 >> we add this new constraint as: >> >> ;; We need a special memory constraint for the misaligned memory access >> ;; This is only for TARGET_MISALIGN target >> (define_special_memory_constraint "B" >> "Memory

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Eric Botcazou
> we add this new constraint as: > > ;; We need a special memory constraint for the misaligned memory access > ;; This is only for TARGET_MISALIGN target > (define_special_memory_constraint "B" > "Memory reference whose address is misaligned" > (and (match_code "mem") > (match_test

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Qing Zhao
> On Jul 11, 2017, at 4:24 PM, Eric Botcazou wrote: > >> we need to generate misaligned load/store insns ONLY for misaligned memory >> access, therefore need a new constraints for misaligned address. > > Why? What happens exactly if the memory access turns out to be

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Eric Botcazou
> we need to generate misaligned load/store insns ONLY for misaligned memory > access, therefore need a new constraints for misaligned address. Why? What happens exactly if the memory access turns out to be aligned? -- Eric Botcazou

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Qing Zhao
> On Jul 11, 2017, at 2:00 PM, Eric Botcazou wrote: > >> the problem I had is: >> >> 1. we added a new special_memory_constraint for misaligned memory access, >> one important requirement for this new special_memory_constraint is, the >> address of the memory access is

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Eric Botcazou
> the problem I had is: > > 1. we added a new special_memory_constraint for misaligned memory access, > one important requirement for this new special_memory_constraint is, the > address of the memory access is misaligned. OK, it's the other way around from the usage of

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Qing Zhao
thanks for the replying. > On Jul 11, 2017, at 2:44 AM, Eric Botcazou wrote: > >> From the above doc, the major difference between a memory_constraint and a >> special_memory_constraint is: whether "reload can or cannot make them match >> by reloading the address". > >

Re: A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-11 Thread Eric Botcazou
> From the above doc, the major difference between a memory_constraint and a > special_memory_constraint is: whether "reload can or cannot make them match > by reloading the address". Right, i.e. by just changing the form of the address (instead of the address itself). > For memory_constraint,

A potential bug in lra-constraints.c for special_memory_constraint?

2017-07-10 Thread Qing Zhao
Hi,team: The following doc for memory_constraint and special_memory_constraint seems imply that the handling of the special_memory_constraint in lra-constraints.c is NOT correct: (https://gcc.gnu.org/onlinedocs/gccint/Define-Constraints.html#Define-Constraints) MD Expression: