This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Alignment fault during function call
On Thu, Aug 5, 2010 at 6:20 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> On 08/05/2010 05:59 PM, Michael Matz wrote:
>> Hi,
>>
>> On Thu, 5 Aug 2010, Bernd Schmidt wrote:
>>
>>> + ?/* Avoid nesting calls. ?We allow a few things which we're certain won't
>>> + ? ? generate library calls. ?*/
>>> + ?if (is_gimple_call (use_stmt)
>>> + ? ? ?&& gimple_assign_rhs_code (stmt) != VAR_DECL
>>> + ? ? ?&& gimple_assign_rhs_code (stmt) != PARM_DECL)
>>> + ? ?return false;
>>
>> You want to allow SSA_NAMEs at least here.
>
> Well, if the SSA_NAME was set in a division for example, won't that lead
> to a libfunc to __div<mode>3? ?I saw a case like that in testing.
Sure. But see cfgexpand.c where the TERing is important to get
alignment right.
/* TER addresses into arguments of builtin functions so we have a
chance to infer more correct alignment information. See PR39954. */
if (builtin_p
&& TREE_CODE (arg) == SSA_NAME
&& (def = get_gimple_for_ssa_name (arg))
&& gimple_assign_rhs_code (def) == ADDR_EXPR)
arg = gimple_assign_rhs1 (def);
Richard.
>
> Bernd
>