This is the mail archive of the gcc-bugs@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]

[Bug c++/23426] New: partial fix too large array problem


A testcase that has an array larger than half the address space and smaller than
the address space will trigger an abort in tree_int_cst_low.

The problem here is that we have a TREE_OVERFLOW (TYPE_SIZE (...)) check in the
C++ front end.  This no longer works now that TYPE_SIZE is computed as
bitsizetype which has extra precision.  We must use TYPE_SIZE_UNIT instead. 
This is trivial to fix, but now the testcase gets two errors instead of the
expected one error.  I don't know if this is intended behaviour, or whether this
is a latent bug in the C++ front end.  Either way, my testcase doesn't work for
the testsuite because of this problem, so a C++ front end maintainer will have
to decide what to do.

Result without the patch
large-size-array.cc: In function ?int main()?:
large-size-array.cc:17: internal compiler error: in tree_low_cst, at tree.c:4270

Result with the patch
large-size-array.cc: In function ?int main()?:
large-size-array.cc:19: error: size of array ?a? is too large
large-size-array.cc:20: error: ?a? was not declared in this scope

Both of these results are wrong.

-- 
           Summary: partial fix too large array problem
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wilson at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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