This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR c++/18121 and middle-end/17407


Two related problems relating to code which was added to the code added
to the tree-ssa branch. The problem was fixed in the wrong spot rather
than in the middle-end we fixed in the front-ends which caused C++/18121.
But since we could have a typedef so we don't layout the array type.
The way I fixed both problems is to revert the patch which fixed
PR middle-end/12920 and have build_array_type layout the type even if
the index_type is NULL.


OK? Bootstrapped and tested on powerpc-darwin.

Thanks,
Andrew Pinski

ChangeLog:

	* c-decl.c (grokdeclarator) <case cdk_array>: Remove the call
	layout_type as it is already done by build_array_type.
	* tree.c (build_array_type): Don't return early if index_type
	is NULL.  Just don't call iterative_hash_object on it.

cp/ChangeLog:
	* decl.c (grokdeclarator) <case cdk_array>: Remove the call
	layout_type as it is already done by create_array_type_for_decl.

testsuite/ChangeLog:
	* gcc.c-torture/compile/pr17407.c: New test.
	* g++.dg/template/array8.C: New test.



Attachment: temp.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]