https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126838
Bug ID: 126838
Summary: [13/14/15/16/17 Regression] --disable-checking with
non GCC is still broken since r0-114131
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: build, ice-on-valid-code, wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
1 broke --disable-checking when the srcmode != destmode case.
The src mode is the mode of the type of the variable while dest mode is the
mode of the dest. This might happen for an example on an aarch64 target.
Basically the call to promote_ssa_mode needs NOT be under gcc_assert in
insert_value_copy_on_edge.
Since this only shows up with --disable-checking with a non GCC I am not sure
we care that much and consider it has been broken for 15 years maybe it is time
to force assert checking on always instead.
Note the patch to fix this was sent as
https://gcc.gnu.org/pipermail/gcc-patches/2026-August/727383.html
It gets a few things wrong and it is LLM created.
One thing it gets wrong is `any host compiler reporting less than 4.5 takes
this branch.` But anything before GCC 5.4.0 won't build GCC 16+ and anything
before GCC 4.8.5 won't build GCC 13.
So the only case this really matters is a non-GCC build. Maybe we can force
assert checking on for non-GCC builds.
That is change:
```
#else
/* Include EXPR, so that unused variable warnings do not occur. */
#define gcc_assert(EXPR) ((void)(0 && (EXPR)))
#endif
```
into:
```
#else
#define gcc_assert(EXPR) \
((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
#endif
```