Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E0093] Declaration of unknown intrinsic function #2407

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

MahadMuhammad
Copy link
Contributor

E0093 unknown builtin intrinsic: foo

  • Refactored Error Message similiar to rustc.
  • See on godbolt

Running Testcases:

Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O0   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O0 -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -O0   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -O0  (test for excess errors)
Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O1   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O1 -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -O1   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -O1  (test for excess errors)
Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O2   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O2 -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -O2   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -O2  (test for excess errors)
Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O3 -g   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O3 -g -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -O3 -g   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -O3 -g  (test for excess errors)
Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -Os   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -Os -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -Os   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -Os  (test for excess errors)
Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O2 -flto -fno-use-linker-plugin -flto-partition=none   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O2 -flto -fno-use-linker-plugin -flto-partition=none -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (test for excess errors)
Executing on host: /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs   -fdiagnostics-plain-output   -frust-incomplete-and-experimental-compiler-do-not-use   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   -S -o intrinsics-3.s    (timeout = 300)
spawn -ignore SIGHUP /home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../gccrs -B/home/mahad/Desktop/mahad/gccrs-build/gcc/testsuite/rust/../../ /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -S -o intrinsics-3.s
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/torture/intrinsics-3.rs:8:14: error: unrecognized intrinsic function: 'not_an_intrinsic' [E0093]
compiler exited with status 1
PASS: rust/compile/torture/intrinsics-3.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   (test for errors, line 8)
PASS: rust/compile/torture/intrinsics-3.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors)

gcc/rust/ChangeLog:

* backend/rust-compile-intrinsic.cc (Intrinsics::compile): called error function.

gcc/testsuite/ChangeLog:

* rust/compile/torture/intrinsics-3.rs: Updated comment to pass the test case.

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added the diagnostic diagnostic static analysis label Jul 11, 2023
@philberty philberty added this to the GCC 14 Stage 3 milestone Jul 11, 2023
@philberty philberty added this pull request to the merge queue Jul 11, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 11, 2023
@philberty philberty added this pull request to the merge queue Jul 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 12, 2023
Refactored error message similiar to rustc.

gcc/rust/ChangeLog:

	* backend/rust-compile-intrinsic.cc (Intrinsics::compile):
	called error function.

gcc/testsuite/ChangeLog:

	* rust/compile/torture/intrinsics-3.rs: Updated comment to pass the test case.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added this pull request to the merge queue Jul 14, 2023
Merged via the queue into Rust-GCC:master with commit 04353fb Jul 14, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants