[Bug tree-optimization/58253] IPA-SRA creates calls with different arguments that the callee accepts

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 29 11:31:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58253

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #2)
> Isn't it easier to avoid building a type with different alignment
> in the first place?  Or do this adjustment in SRA where the bug
> happens?  It seems that when SRA representatives ->type is unaligned
> that this means, for by value passing, the value is accessed unaligned
> in the caller only.  Thus turn_representatives_into_adjustments
> should go back to naturally aligned ->type for !by_ref params.
> 

That's what the first version of my patch did :-) The problem with it
is that the alignment of the type in adjustment is how
ipa_modify_call_arguments figures out it needs to build unaligned
loads in the caller and so those types need to stay unaligned and only
ipa_modify_formal_parameters needs to be taught to ignore that.

BTW, now I wonder whether it would make more sense to check for
is_gimple_reg_type instead of non-BLKmode-ness with perhaps the latter
asserted.  Arguably, the actual arguments are (formally well aligned)
SSA names because their type is a gimple register.



More information about the Gcc-bugs mailing list