Bug 116561 - [15 regression] gcc/testsuite/rust/execute/torture/iter1.rs:350:5: internal compiler error: 'verify_gimple' failed since r15-3328-g673a448aa24efedd5ac140ebf7bfe652d7a6a846
Summary: [15 regression] gcc/testsuite/rust/execute/torture/iter1.rs:350:5: internal c...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: rust (show other bugs)
Version: 15.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: testsuite-fail
Depends on:
Blocks:
 
Reported: 2024-09-01 19:39 UTC by Mark Wielaard
Modified: 2024-09-02 23:22 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-09-02 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2024-09-01 19:39:10 UTC
A gcc configured with --enable-languages=rust and --enable-checking=yes,extra,rtl will show failures in rust/rust/execute/torture/iter1.rs with internal compiler error: 'verify_gimple' failed

https://builder.sourceware.org/buildbot/#/builders/312/builds/24

		=== rust tests ===
Running target unix
FAIL: rust/execute/torture/iter1.rs   -O1  (internal compiler error: 'verify_gimple' failed)
FAIL: rust/execute/torture/iter1.rs   -O1  (test for excess errors)
UNRESOLVED: rust/execute/torture/iter1.rs   -O1  compilation failed to produce executable
FAIL: rust/execute/torture/iter1.rs   -O2  (internal compiler error: 'verify_gimple' failed)
FAIL: rust/execute/torture/iter1.rs   -O2  (test for excess errors)
UNRESOLVED: rust/execute/torture/iter1.rs   -O2  compilation failed to produce executable
FAIL: rust/execute/torture/iter1.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (internal compiler error: 'verify_gimple' failed)
FAIL: rust/execute/torture/iter1.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (test for excess errors)
UNRESOLVED: rust/execute/torture/iter1.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none  compilation failed to produce executable
FAIL: rust/execute/torture/iter1.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (internal compiler error: 'verify_gimple' failed)
FAIL: rust/execute/torture/iter1.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors)
UNRESOLVED: rust/execute/torture/iter1.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  compilation failed to produce executable
FAIL: rust/execute/torture/iter1.rs   -O3 -g  (internal compiler error: 'verify_gimple' failed)
FAIL: rust/execute/torture/iter1.rs   -O3 -g  (test for excess errors)
UNRESOLVED: rust/execute/torture/iter1.rs   -O3 -g  compilation failed to produce executable
FAIL: rust/execute/torture/iter1.rs   -Os  (internal compiler error: 'verify_gimple' failed)
FAIL: rust/execute/torture/iter1.rs   -Os  (test for excess errors)
UNRESOLVED: rust/execute/torture/iter1.rs   -Os  compilation failed to produce executable
		=== rust Summary ===
# of expected passes		8421
# of unexpected failures	12
# of expected failures		69
# of unresolved testcases	6
# of unsupported tests		1

Logs are in bunsen:
https://builder.sourceware.org/testrun/a838fa2940edef1f921401c6066417d2e88b6008?rawfilename=gcc%2Ftestsuite%2Frust%2Frust.log

Executing on host: /home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc-build/gcc/testsuite/rust/../../gccrs -B/home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc-build/gcc/testsuite/rust/../../  /home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc/gcc/testsuite/rust/execute/torture/iter1.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O1     -lm  -o ./iter1.exe    (timeout = 10)
spawn -ignore SIGHUP /home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc-build/gcc/testsuite/rust/../../gccrs -B/home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc-build/gcc/testsuite/rust/../../ /home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc/gcc/testsuite/rust/execute/torture/iter1.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O1 -lm -o ./iter1.exe
/home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc/gcc/testsuite/rust/execute/torture/iter1.rs: In function '<T as iter1::TryFrom::<U>>::try_from<usize, usize>':
/home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc/gcc/testsuite/rust/execute/torture/iter1.rs:350:5: error: non-trivial conversion in 'constructor'
union iter1::result::Result<usize, usize>
union iter1::result::Result<usize, !>
D.4488 = {};
/home/builder/shared/x3d1/worker/gcc-fullest-debian-amd64/gcc/gcc/testsuite/rust/execute/torture/iter1.rs:350:5: internal compiler error: 'verify_gimple' failed
0x332987b internal_error(char const*, ...)
	../../gcc/gcc/diagnostic-global-context.cc:492
0x1bcbcc6 verify_gimple_in_seq(gimple*, bool)
	../../gcc/gcc/tree-cfg.cc:5332
0x17e56ba gimplify_body(tree_node*, bool)
	../../gcc/gcc/gimplify.cc:19488
0x17e5865 gimplify_function_tree(tree_node*)
	../../gcc/gcc/gimplify.cc:19606
0x15e7087 cgraph_node::analyze()
	../../gcc/gcc/cgraphunit.cc:687
0x15e9e87 analyze_functions
	../../gcc/gcc/cgraphunit.cc:1251
0x15eaeb4 symbol_table::finalize_compilation_unit()
	../../gcc/gcc/cgraphunit.cc:2560
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.
compiler exited with status 1
FAIL: rust/execute/torture/iter1.rs   -O1  (internal compiler error: 'verify_gimple' failed)

That is this function:

impl<T, U> TryFrom<U> for T
where
    T: From<U>,
{
    type Error = !;

    fn try_from(value: U) -> Result<Self, Self::Error> {
        Ok(T::from(value))
    }
}
Comment 1 Thomas Schwinge 2024-09-02 14:22:10 UTC
This appears to be due to recent commit r15-3328-g673a448aa24efedd5ac140ebf7bfe652d7a6a846 "Optimize initialization of small padded objects".

Given this commit doesn't appear to be causing any other issues, chances are that the Rust front end is doing "something funny"?