LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 19650 - gcc-4.9.0 for ARM fails to build due to "nesting brackets exceeds limit" error
Summary: gcc-4.9.0 for ARM fails to build due to "nesting brackets exceeds limit" error
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: 3.4
Hardware: PC All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-04 01:49 PDT by Chris Johns
Modified: 2015-05-13 12:56 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments
ARM md preprocessed output (130.80 KB, application/octet-stream)
2014-05-05 08:35 PDT, Chris Johns
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Johns 2014-05-04 01:49:13 PDT
Building gcc-4.9.0 for the arm target using clang on OSX and FreeBSD 10 fails with an error. The error message for OSX can be seen in the post to the gcc mailing list here http://gcc.gnu.org/ml/gcc/2014-05/msg00014.html. The thread contains a comment from a gcc developer the file does not have this level of nesting brackets.
Comment 1 Anton Korobeynikov 2014-05-04 03:53:46 PDT
Please attach the preprocessed source of the file in question
Comment 2 Chris Johns 2014-05-05 08:35:33 PDT
Created attachment 12477 [details]
ARM md preprocessed output

The file shows gcc is generating source with over 288 nested brackets. I have decided to add the file here because I need to upload it somewhere. I will let gcc know the file is here.

It is line 51623 that has (I think) 288 brackets.

The name of the bug is wrong because it is not false and can be changed if required.
Comment 3 Richard Smith 2014-05-08 01:44:03 PDT
(In reply to comment #0)
> The thread contains a comment from a gcc developer the file does not have
> this level of nesting brackets.

So... this gcc developer was not correct; as you observed, the preprocessed source contains this on line 51623:

))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

This exceeds the suggested implementation limit of 256 for "nesting levels of parenthesized expressions within a full-expression" given in Annex B of the C++ standard.

That said, we should probably increase our default limit here. I expect we can set it a lot higher and still be safe from stack overflow on typical systems.
Comment 4 Chris Johns 2014-05-08 02:06:57 PDT
(In reply to comment #3)
> This exceeds the suggested implementation limit of 256 for "nesting levels
> of parenthesized expressions within a full-expression" given in Annex B of
> the C++ standard.

I will raise a bug on gcc and reference this comment. Thanks. I think they are willing to look into the issue and alter the way they generate this code and this is a nice reason to do so.

> That said, we should probably increase our default limit here. I expect we
> can set it a lot higher and still be safe from stack overflow on typical
> systems.

There is a way to override the default and that is what we are doing.