[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 Jakub Jelinek changed: What|Removed |Added Keywords|needs-bisection | Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from Jakub Jelinek --- Should be fixed now.
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 --- Comment #6 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:1fb467dbcc2cdd3bb89fa860a1f86b7e334e0ce3 commit r15-4863-g1fb467dbcc2cdd3bb89fa860a1f86b7e334e0ce3 Author: Jakub Jelinek Date: Sat Nov 2 18:47:27 2024 +0100 gimplify: Fix up RAW_DATA_CST related ICE [PR117384] Apparently tree_output_constant_def doesn't strictly guarantee that the returned VAR_DECL will have the same or uselessly convertible type as the type of the constant passed to it, compare_constants says: /* For arrays, check that mode, size and storage order match. */ /* For record and union constructors, require exact type equality. */ The older use of tree_output_constant_def in gimplify.cc was already handling this right: ctor = tree_output_constant_def (ctor); if (!useless_type_conversion_p (type, TREE_TYPE (ctor))) ctor = build1 (VIEW_CONVERT_EXPR, type, ctor); but the spot I've added for RAW_DATA_CST missed this. So, the following patch adds that. 2024-11-02 Jakub Jelinek PR middle-end/117384 * gimplify.cc (gimplify_init_ctor_eval): Add VIEW_CONVERT_EXPR around rctor if it doesn't have expected type. * c-c++-common/init-7.c: New test.
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 Jakub Jelinek changed: What|Removed |Added Last reconfirmed||2024-10-31 Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED --- Comment #5 from Jakub Jelinek --- Created attachment 59514 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59514&action=edit gcc15-pr117384.patch Seems tree_output_constant_def intentionally allows some type mismatches, and the other gimplify.cc caller of that function already deals with that using VCE.
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 --- Comment #4 from Andreas Schwab --- s/unsigned/signed/ to make it fail the same with -funsigned-char.
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 --- Comment #3 from Sam James --- Works with -funsigned-char.
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 --- Comment #2 from Sam James --- ``` void a() { char b[] = { 144, 128, 112, 96, 80, 64, 48, 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 24, 39, 54, 69, 84, 99, 114, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136}; } void c() { unsigned char b[] = { 144, 128, 112, 96, 80, 64, 48, 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 24, 39, 54, 69, 84, 99, 114, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136}; } ```
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 Sam James changed: What|Removed |Added Keywords|needs-reduction | CC||jakub at gcc dot gnu.org --- Comment #1 from Sam James --- ``` void testDES2() { char testString[] = { 0x90, 0x80, 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 1,2,3,4, 5,6,7,8,9,0x18, 0x27, 0x36, 0x45, 0x54, 0x63, 0x72, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}; } void testDES3() { unsigned char testString[] = { 0x90, 0x80, 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 1,2,3,4, 5,6,7,8,9,0x18, 0x27, 0x36, 0x45, 0x54, 0x63, 0x72, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x22, 0x33, 0x44, 0x55, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136, 153, 136, 119, 102, 85, 68, 51, 34, 17, 34, 51, 68, 85, 102, 119, 136}; } ```
[Bug middle-end/117384] [15 regression] ICE when building gwenhywfar-5.10.1 (error: non-trivial conversion in ‘var_decl’)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117384 Richard Biener changed: What|Removed |Added Target Milestone|--- |15.0 Keywords||needs-bisection, ||needs-reduction