https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121494

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |ice-on-valid-code

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is the hack which I used to reproduce it:
```
apinski@xeond:~/src/upstream-gcc/gcc/objdir/gcc/t$ git diff
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index ca1fa2189cb..354893a4323 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -6532,7 +6532,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq
*pre_p, gimple_seq *post_p,
                && (num_unique_nonzero_elements
                    > num_nonzero_elements / unique_nonzero_ratio
                    || size <= min_unique_size)
-               && (size < num_nonzero_elements
+               && (size < num_nonzero_elements || true
                    || !can_move_by_pieces (size, align)))
              {
                if (notify_temp_creation)

```

I forgot to copy what I did for optimize_aggr_zeroprop into what is needed for
optimize_agr_copyprop too.

This is the ICE:
```
c41303a.adb: In function ‘C41303A’:
c41303a.adb:120:5: error: statement marked for throw, but doesn’t
# .MEM_23 = VDEF <.MEM_20>
VIEW_CONVERT_EXPR<struct c41303a__B_1__rec>(rec_var) = *.LC3;
during GIMPLE pass: forwprop
dump file: c41303a.adb.038t.forwprop1
+===========================GNAT BUG DETECTED==============================+
| 16.0.0 20250810 (experimental) [trunk 415e492537c] (x86_64-pc-linux-gnu) GCC
error:|
| verify_gimple failed                                                     |
| Error detected around c41303a.adb:120:5                                  |
| Compiling c41303a.adb                                                    |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

c41303a.adb
/home/apinski/src/upstream-gcc/gcc/objdir/gcc/testsuite/ada/acats-41/../acats-4/support/report.ads


raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:422
gnatmake: "c41303a.adb" compilation error

```

Reply via email to