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]

Re: [PR 18672]: Fix gimplificication ICE


Nathan Sidwell wrote:
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?

OK.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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