llvm-project/flang/test
Peter Steinfeld 5a9497d689 [flang] Allow large and erroneous ac-implied-do's
We sometimes unroll an ac-implied-do of an array constructor into a flat list
of values.  We then re-analyze the array constructor that contains the
resulting list of expressions.  Such a list may or may not contain errors.

But when processing an array constructor with an unrolled ac-implied-do, the
compiler was building an expression to represent the extent of the resulting
array constructor containing the list of values.  The number of operands
in this extent expression was based on the number of elements in the
unrolled list of values.  For very large lists, this created an
expression so large that it could not be evaluated by the compiler
without overflowing the stack.

I fixed this by continuously folding the extent expression as each operand is
added to it.  I added the test .../flang/test/Semantics/array-constr-big.f90
that will cause the compiler to seg fault without this change.

Also, when the unrolled ac-implied-do expression contains errors, we were
repeating the same error message referencing the same source line for every
instance of the erroneous expression in the unrolled list.  This potentially
resulted in a very long list of messages for a single error in the source code.

I fixed this by comparing the message being emitted to the previously emitted
message.  If they are the same, I do not emit the message.  This change is also
tested by the new test array-constr-big.f90.

Several of the existing tests had duplicate error messages for the same source
line, and this change caused differences in their output.  So I adjusted the
tests to match the new message emitting behavior.

Differential Revision: https://reviews.llvm.org/D102210
2021-05-11 10:04:18 -07:00
..
Driver [flang] Remove `%f18` from LIT configuration files 2021-05-06 08:42:25 +00:00
Evaluate [flang] Switch from %f18 to %flang_fc1 in a test 2021-04-23 15:10:07 +00:00
Fir [flang][fir] Add the pre-code gen rewrite pass and codegen ops. 2021-03-24 19:27:10 -07:00
Frontend [flang][driver] Remove `%flang-new` from the LIT configuration 2021-04-13 10:55:01 +00:00
Lower [flang] Update the regression tests to use the new driver when enabled 2021-04-15 08:52:23 +00:00
NonGtestUnit [flang] Run non-gtest unit tests with lit. 2020-07-24 14:49:39 +01:00
Parser [flang] Update the regression tests to use the new driver when enabled 2021-04-15 08:52:23 +00:00
Preprocessing [flang][driver] Update PP tests to use the new driver 2021-01-25 12:32:23 +00:00
Semantics [flang] Allow large and erroneous ac-implied-do's 2021-05-11 10:04:18 -07:00
Unit [flang] unit test support for out-of-tree and in-tree using google tests framework 2020-06-15 22:09:56 +05:30
CMakeLists.txt [flang] Build intrinsic .mod files in include/flang 2021-03-15 08:03:02 -07:00
lit.cfg.py [flang] Remove `%f18` from LIT configuration files 2021-05-06 08:42:25 +00:00
lit.site.cfg.py.in [flang][driver] Add the new flang compiler and frontend drivers 2020-09-11 10:55:54 +01:00