Bug 55415 - Early SRA produces unaligned complex types
Summary: Early SRA produces unaligned complex types
Status: RESOLVED DUPLICATE of bug 54386
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Martin Jambor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-20 16:56 UTC by Richard Henderson
Modified: 2012-12-03 13:27 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-11-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Henderson 2012-11-20 16:56:43 UTC
While looking at PR55403 one has to wonder where the unaligned
complex long double type came from in the first place:

#0  copy_node_stat (node=0x7ffff1aeb9d8) at ../../git-master/gcc/tree.c:961
#1  0x0000000000e33162 in build_distinct_type_copy (type=0x7ffff1aeb9d8)
    at ../../git-master/gcc/tree.c:5856
#2  0x0000000000e332d5 in build_variant_type_copy (type=0x7ffff1aeb9d8)
    at ../../git-master/gcc/tree.c:5890
#3  0x0000000000e33119 in build_aligned_type (type=0x7ffff1aeb9d8, align=8)
    at ../../git-master/gcc/tree.c:5842
#4  0x0000000000a39b7d in ipa_modify_call_arguments (cs=0x7ffff11493a8, 
    stmt=0x7ffff1147428, adjustments=...)
    at ../../git-master/gcc/ipa-prop.c:2967

I'm still not quite sure why ipa_modify_call_arguments *ever* wants to
create misaligned types as function interfaces?
Comment 1 Richard Henderson 2012-11-20 17:08:15 UTC
The call to get_pointer_alignment_1 at ipa-prop.c:2959
does not do what the author intended.  In particular we
really really need to notice the "false" return value
when the results are conservative, and do nothing.
Comment 2 Martin Jambor 2012-11-20 20:33:37 UTC
I'm looking into this.
Comment 3 Jakub Jelinek 2012-11-23 18:01:56 UTC
Possibly related to PR55448.
Comment 4 Martin Jambor 2012-11-27 20:46:11 UTC
I have proposed a patch on the mailing list:

http://gcc.gnu.org/ml/gcc-patches/2012-11/msg02265.html
Comment 5 Martin Jambor 2012-11-30 16:11:43 UTC
Author: jamborm
Date: Fri Nov 30 16:11:33 2012
New Revision: 193998

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193998
Log:
2012-11-30  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/52890
	PR tree-optimization/55415
	PR tree-optimization/54386
	PR target/55448
	* ipa-prop.c (ipa_modify_call_arguments): Be optimistic when
	get_pointer_alignment_1 returns false and the base was not a
	dereference.
	* tree-sra.c (access_precludes_ipa_sra_p): New parameter req_align,
	added check for required alignment.  Update the user.

	* testsuite/gcc.dg/ipa/ipa-sra-7.c: New test.
	* testsuite/gcc.dg/ipa/ipa-sra-8.c: Likewise.
	* testsuite/gcc.dg/ipa/ipa-sra-9.c: Likewise.
	* testsuite/gcc.target/i386/pr55448.c: Likewise.


Added:
    trunk/gcc/testsuite/gcc.dg/ipa/ipa-sra-7.c
    trunk/gcc/testsuite/gcc.dg/ipa/ipa-sra-8.c
    trunk/gcc/testsuite/gcc.dg/ipa/ipa-sra-9.c
    trunk/gcc/testsuite/gcc.target/i386/pr55448.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-prop.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c
Comment 6 Martin Jambor 2012-12-03 13:27:50 UTC
Duplicate. A fixed one, fortunately.

*** This bug has been marked as a duplicate of bug 54386 ***