This prevents either a crash or an assertion failure in gigi on an array with dynamic subtype that is wrongly flagged as static by the front-end because of a recent improvement made in the handling of nested aggregates. The patch reuses the existing Static_Array_Aggregate predicate instead of fixing the problematic test, pluging a few loopholes in the process. The predicate is conservatively correct but should be good enough in practice. 2018-12-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_aggr.adb (Convert_To_Positional): Use Static_Array_Aggregate to decide whether to set Compile_Time_Known_Aggregate on an already flat aggregate. (Expand_Array_Aggregate): Remove test on Compile_Time_Known_Aggregate that turns out to be dead and simplify. (Is_Static_Component): New predicate extracted from... (Static_Array_Aggregate): ...here. Test neither Is_Tagged_Type nor Is_Controlled for the type, but test whether the component type has discriminants. Use the Is_Static_Component predicate consistently for the positional and named cases. gcc/testsuite/ * gnat.dg/array32.adb, gnat.dg/array32.ads: New testcase. From-SVN: r266755
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ada | Loading commit data... | |
brig.dg | Loading commit data... | |
c-c++-common | Loading commit data... | |
config | Loading commit data... | |
g++.dg | Loading commit data... | |
g++.old-deja | Loading commit data... | |
g++.target | Loading commit data... | |
gcc.c-torture | Loading commit data... | |
gcc.dg | Loading commit data... | |
gcc.dg-selftests | Loading commit data... | |
gcc.misc-tests | Loading commit data... | |
gcc.src | Loading commit data... | |
gcc.target | Loading commit data... | |
gcc.test-framework | Loading commit data... | |
gdc.dg | Loading commit data... | |
gdc.test | Loading commit data... | |
gfortran.dg | Loading commit data... | |
gfortran.fortran-torture | Loading commit data... | |
gnat.dg | Loading commit data... | |
go.dg | Loading commit data... | |
go.go-torture/execute | Loading commit data... | |
go.test | Loading commit data... | |
jit.dg | Loading commit data... | |
lib | Loading commit data... | |
obj-c++.dg | Loading commit data... | |
objc | Loading commit data... | |
objc-obj-c++-shared | Loading commit data... | |
objc.dg | Loading commit data... | |
selftests | Loading commit data... | |
.gitattributes | Loading commit data... | |
ChangeLog | Loading commit data... | |
ChangeLog-1993-2007 | Loading commit data... | |
ChangeLog-2008 | Loading commit data... | |
ChangeLog-2009 | Loading commit data... | |
ChangeLog-2010 | Loading commit data... | |
ChangeLog-2011 | Loading commit data... | |
ChangeLog-2012 | Loading commit data... | |
ChangeLog-2013 | Loading commit data... | |
ChangeLog-2014 | Loading commit data... | |
ChangeLog-2015 | Loading commit data... | |
ChangeLog-2016 | Loading commit data... | |
ChangeLog-2017 | Loading commit data... | |
ChangeLog.graphite | Loading commit data... | |
ChangeLog.jit | Loading commit data... | |
ChangeLog.ptr | Loading commit data... | |
ChangeLog.tree-ssa | Loading commit data... | |
README | Loading commit data... | |
README.compat | Loading commit data... | |
README.gcc | Loading commit data... |