Message ID | 201211030503.qA353WMj028488@ignucius.se.axis.com |
---|---|
State | New |
Headers | show |
> But, for cris-elf (and reasonably the same for other targets) > there might not be such a constant-pool entry in the first > place: the vectors are too short to rule out piecewise > initialization as optimal for size (counting the vectors once > per use). Let's increase them. Twice might just break-even for > cris-elf so let's make them four times as long. Sanity-checked > for x86_64 w/w.o -m32 for a gcc-version that includes the > optimization for which the test-case tests (CCing author). I don't know cris at all, but 4 times sounds quite a lot compared to the other architectures (I presume that the test passes on most of them). > Ok to commit? > > gcc/testsuite: > PR testsuite/55186 > * gcc/testsuite/gcc.dg/const-uniq-1.c (a): Increase length four times. No objections by me though.
Index: gcc/testsuite/gcc.dg/const-uniq-1.c =================================================================== --- gcc/testsuite/gcc.dg/const-uniq-1.c (revision 193117) +++ gcc/testsuite/gcc.dg/const-uniq-1.c (working copy) @@ -5,13 +5,18 @@ int lookup1 (int i) { - int a[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + /* We use vectors long enough that piece-wise initialization is not + reasonably preferable even for size (when including the constant + vectors for initialization) for any target. */ + int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; return a[i]; } int lookup2 (int i) { - int a[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; return a[i+1]; }