[PR 18672]: Fix gimplificication ICE

Nathan Sidwell nathan@codesourcery.com
Wed Dec 1 16:32:00 GMT 2004


PR c++/18672 concerns some templatized c++ code.  However the fault
is not template based, and as you'll see I have a non-template test
case.

The bug is in canonicalize_addr_expr, which presumes an array's
elements cannot have incomplete type.  That is incorrect as
	struct X;
	extern struct X ary[];
is perfectly legal C and C++.  when the address of ARY is taken,
C produces an expression of type 'struct X *', whereas C++ produces
one of type 'struct X (*)[]', and that confuses the canonicalizer.

Whilst there I noticed some redundant checks in gimplify_conversion.
That function's comment says the EXPR is already a NOP_EXPR or
CONVERT_EXPR, and indeed its only caller enforces that.

booted & tested on i686-pc-linux-gnu, ok?

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 18672.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041201/685c28b9/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 18672.C
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041201/685c28b9/attachment-0001.ksh>


More information about the Gcc-patches mailing list