public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
@ 2022-04-12 19:33 zsojka at seznam dot cz
2022-04-13 6:46 ` [Bug ipa/105250] " rguenth at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2022-04-12 19:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
Bug ID: 105250
Summary: ICE: in fold_convert_loc, at fold-const.cc:2581 with
conflicting function redeclaration
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Created attachment 52792
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52792&action=edit
reduced testcase
The testcase is broken in a similar way as PR105140
Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
testcase.c:9:1: warning: return type defaults to 'int' [-Wimplicit-int]
9 | foo(int, int, int, int, U, U, V, V, W, W, int,
| ^~~
testcase.c:9:1: warning: conflicting types for 'foo'
testcase.c:7:6: note: previous declaration of 'foo' with type 'void()'
7 | void foo();
| ^~~
testcase.c: In function 'foo':
testcase.c:9:1: note: the ABI for passing parameters with 32-byte alignment has
changed in GCC 4.6
9 | foo(int, int, int, int, U, U, V, V, W, W, int,
| ^~~
during IPA pass: inline
testcase.c:16:3: internal compiler error: in fold_convert_loc, at
fold-const.cc:2581
16 | foo(0, 0, 0, 0, (U){}, (U){}, (V){}, (V){}, (W){},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 | (W){}, 2, (T){}, 0, 0, 0, 0, (U){}, (U){},
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 | (V){}, (V){}, (W){}, (W){}, (T){},
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | (T){}, 0, 0, 0, 0, (U){}, (U){}, (V){},
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 | (V){}, (W){}, (W){}, (T){}, (T){}, 0, 0, 0,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 | 0, 0, 0, (T){},
| ~~~~~~~~~~~~~~~
22 | (T){}, (W){},
| ~~~~~~~~~~~~~
23 | (W){}, (T){}, (T){}, 0, 0, 0, 0, 0, 0, (W){},
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 | (V){}, (W){}, (T){}, 0, 0, (U){}, (F){});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x6db3be fold_convert_loc(unsigned int, tree_node*, tree_node*)
/repo/gcc-trunk/gcc/fold-const.cc:2581
0x1415210 setup_one_parameter
/repo/gcc-trunk/gcc/tree-inline.cc:3549
0x142031a initialize_inlined_parameters
/repo/gcc-trunk/gcc/tree-inline.cc:3642
0x142031a expand_call_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5017
0x14229c6 gimple_expand_calls_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5320
0x14229c6 optimize_inline_calls(tree_node*)
/repo/gcc-trunk/gcc/tree-inline.cc:5492
0x110d0cb inline_transform(cgraph_node*)
/repo/gcc-trunk/gcc/ipa-inline-transform.cc:790
0x1289f16 execute_one_ipa_transform_pass
/repo/gcc-trunk/gcc/passes.cc:2330
0x1289f16 execute_all_ipa_transforms(bool)
/repo/gcc-trunk/gcc/passes.cc:2393
0xeb520d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.cc:1828
0xeb520d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.cc:1788
0xeb6806 expand_all_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:1999
0xeb6806 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2349
0xeb93e7 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2262
0xeb93e7 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2530
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
@ 2022-04-13 6:46 ` rguenth at gcc dot gnu.org
2022-04-13 7:56 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-13 6:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Blocks| |105140
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Last reconfirmed| |2022-04-13
CC| |rsandifo at gcc dot gnu.org
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. Now that fold_convertible_p doesn't ICE it's still inconsistent in
what fold_convert does. fold_convertible_p:
case VECTOR_TYPE:
return (VECTOR_TYPE_P (orig)
&& known_eq (TYPE_VECTOR_SUBPARTS (type),
TYPE_VECTOR_SUBPARTS (orig))
&& fold_convertible_p (TREE_TYPE (type), TREE_TYPE (orig)));
thus it allows promotion/demotion of elements, while fold_convert:
case VECTOR_TYPE:
if (integer_zerop (arg))
return build_zero_vector (type);
gcc_assert (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));
gcc_assert (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig)
|| TREE_CODE (orig) == VECTOR_TYPE);
return fold_build1_loc (loc, VIEW_CONVERT_EXPR, type, arg);
IIRC Richard originally enhanced fold_convertible_p in r10-5112-gfddcfa5b84bf8a
but it seems that the check didn't really intend to allow the vector
conversions
now possible with NOP_EXPRs but were to prevent IPA-CP from generating invalid
conversions.
So I guess we should simply sync fold_convert and fold_convertible_p here.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105140
[Bug 105140] [10/11 Regression] ICE: SIGSEGV in fold_convertible_p with
conflicting function redeclaration since r10-5112-gfddcfa5b84bf8a06
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
2022-04-13 6:46 ` [Bug ipa/105250] " rguenth at gcc dot gnu.org
@ 2022-04-13 7:56 ` cvs-commit at gcc dot gnu.org
2022-04-13 7:56 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-13 7:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:4e892de6774f86540d36385701aa7b0a2bba5155
commit r12-8134-g4e892de6774f86540d36385701aa7b0a2bba5155
Author: Richard Biener <rguenther@suse.de>
Date: Wed Apr 13 08:52:57 2022 +0200
tree-optimization/105250 - adjust fold_convertible_p PR105140 fix
The following reverts the original PR105140 fix and goes for instead
applying the additional fold_convert constraint for VECTOR_TYPE
conversions also to fold_convertible_p. I did not try sanitizing
all of this at this point.
2022-04-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/105250
* fold-const.cc (fold_convertible_p): Revert
r12-7979-geaaf77dd85c333, instead check for size equality
of the vector types involved.
* gcc.dg/pr105250.c: New testcase.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
2022-04-13 6:46 ` [Bug ipa/105250] " rguenth at gcc dot gnu.org
2022-04-13 7:56 ` cvs-commit at gcc dot gnu.org
@ 2022-04-13 7:56 ` rguenth at gcc dot gnu.org
2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-13 7:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
` (2 preceding siblings ...)
2022-04-13 7:56 ` rguenth at gcc dot gnu.org
@ 2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
2024-02-19 21:40 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-19 14:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:0be87cc23d0b0e07656e94137978971555bebbb3
commit r11-10013-g0be87cc23d0b0e07656e94137978971555bebbb3
Author: Richard Biener <rguenther@suse.de>
Date: Wed Apr 13 08:52:57 2022 +0200
tree-optimization/105250 - adjust fold_convertible_p PR105140 fix
The following reverts the original PR105140 fix and goes for instead
applying the additional fold_convert constraint for VECTOR_TYPE
conversions also to fold_convertible_p. I did not try sanitizing
all of this at this point.
2022-04-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/105250
* fold-const.c (fold_convertible_p): Revert
r12-7979-geaaf77dd85c333, instead check for size equality
of the vector types involved.
* gcc.dg/pr105250.c: New testcase.
(cherry picked from commit 4e892de6774f86540d36385701aa7b0a2bba5155)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
` (3 preceding siblings ...)
2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
@ 2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
2024-02-19 21:40 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-27 13:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:644185d0e42fd93d1f793475a0117d6751fb042e
commit r10-10771-g644185d0e42fd93d1f793475a0117d6751fb042e
Author: Richard Biener <rguenther@suse.de>
Date: Wed Apr 13 08:52:57 2022 +0200
tree-optimization/105250 - adjust fold_convertible_p PR105140 fix
The following reverts the original PR105140 fix and goes for instead
applying the additional fold_convert constraint for VECTOR_TYPE
conversions also to fold_convertible_p. I did not try sanitizing
all of this at this point.
2022-04-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/105250
* fold-const.c (fold_convertible_p): Revert
r12-7979-geaaf77dd85c333, instead check for size equality
of the vector types involved.
* gcc.dg/pr105250.c: New testcase.
(cherry picked from commit 4e892de6774f86540d36385701aa7b0a2bba5155)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
` (4 preceding siblings ...)
2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
@ 2024-02-19 21:40 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-19 21:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.4
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-02-19 21:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 19:33 [Bug ipa/105250] New: ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration zsojka at seznam dot cz
2022-04-13 6:46 ` [Bug ipa/105250] " rguenth at gcc dot gnu.org
2022-04-13 7:56 ` cvs-commit at gcc dot gnu.org
2022-04-13 7:56 ` rguenth at gcc dot gnu.org
2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
2024-02-19 21:40 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).