Hi,

On Thu, 5 Dec 2013 22:16:15, Jeff Law wrote:
>
> On 12/04/13 01:16, Bernd Edlinger wrote:
>
>>
>>> Looking for some more time your patch may be indeed the easiest
>>> without big re-factoring.
> Richard (or Bernd), can you comment on why? Something seems "off" here.
>
> Why do we need to handle inner references here specially? If feels
> like we're catering to broken code elsewhere in GCC.
>

My first attempt at fixing this was just a one-line change.
like:

@@ -9905,7 +9861,7 @@ expand_expr_real_1 (tree exp, rtx target
                          && modifier != EXPAND_STACK_PARM
                          ? target : NULL_RTX),
                         VOIDmode,
-                        modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier);
+                        EXPAND_MEMORY);


But the problem with that was, that it might loose too much information...
i.e. little we know what tem might be, and what a change to the original
expand_modifier would have done at other places where we had no
problems at all.

So this current version of the patch is a trying to get as much flexibility
as possible while changing as little as possible at the same time.

Technically we only have to switch off some places in MEM_REF,
and VIEW_CONVERT_EXPR, where an unaligned value is placed in a
register, which turns out to be unnecessary in this special context.



> As for the patch itself. In a few places within expand_expr_real_1 you
> changed calls to expand_expr to instead call expand_expr_real. ISTM
> you could have gotten the same effect by just adding your extra argument
> to the existing code?
>

Yes, but one goal is to keep the patch-file as small as possible,
and expand_expr is used everywhere.

Actually expand_expr is just a wrapper for

expand_expr_real (exp, target, mode, modifier, NULL, false)

Therefore I replaced expand_expr with expand_expr_real at these few
places, to keep the change smaller.

Another point is, that I do not want to pass true for expand_reference
at any other place than from exand_expr_real_1 where the inner
reference is expanded.


Thanks
Bernd.

>
> Jeff                                    

Reply via email to