[Bug c/86308] [7/8/9 Regression] verify_gimple failed in tree-cfg.c
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 25 15:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86308
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|ice-on-valid-code |ice-on-invalid-code
Status|NEW |ASSIGNED
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=86125,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=86202
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The ICE is due to the same "feature" of the C front-end where incompatible
declarations of built-in functions are accepted when they should be rejected.
The ICE doesn't trigger with -m64 because the incompatible declaration of the
builti-in char* index(const char*, int) function is rejected because
sizeof(int) != sizeof(char*) (i.e., the TYPE_MODE of each type is different).
The code is invalid, of course, because the index() declaration in the program
is incompatible with that of the built-in. It's a deficiency in
-Wbuiltin-declaration-mismatch that the incompatibility isn't diagnosed (this
is tracked n bug 86125)
In the patch I posted for pr86125
(https://gcc.gnu.org/ml/gcc-patches/2018-06/msg00804.html) I tried to preserve
the dubious feature of the C front-end but I now think it would be better to
reject incompatible declarations regardless of TYPE_MODE.
(Strangely, my bisection points to r240783 (gcc 7.0.0) as the first revision to
ICE, even though that revision looks completely unrelated.)
More information about the Gcc-bugs
mailing list