public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
@ 2021-08-15 12:18 xry111 at mengyan1223 dot wang
2021-08-15 12:21 ` [Bug target/101922] " xry111 at mengyan1223 dot wang
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-08-15 12:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
Bug ID: 101922
Summary: mips: illegal instruction at -O3 with -mmsa
-mloongson-mmi
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: xry111 at mengyan1223 dot wang
Target Milestone: ---
$ cat test.c
int x = 0xffffffff;
char d[16];
void f() {
int i;
for (i = 0; i < 16; i++) {
int t = d[i] >> 8;
x &= t;
}
}
$ ~/git-repos/gcc-test-mips/gcc/cc1 test.c -O3 -mmsa -mloongson-mmi -nostdinc
$ mips64el-unknown-linux-gnu-as test.s -mmsa -mloongson-mmi -mips64r2
test.s: Assembler messages:
test.s:29: Error: operand 3 out of range `srai.b $w0,$w0,8'
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/101922] mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
@ 2021-08-15 12:21 ` xry111 at mengyan1223 dot wang
2021-08-20 14:49 ` xry111 at mengyan1223 dot wang
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-08-15 12:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
--- Comment #1 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Technically the testcase above invokes UB, but this is reduced from a file in
openssl-1.1.1k.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/101922] mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
2021-08-15 12:21 ` [Bug target/101922] " xry111 at mengyan1223 dot wang
@ 2021-08-20 14:49 ` xry111 at mengyan1223 dot wang
2021-08-20 17:33 ` xry111 at mengyan1223 dot wang
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-08-20 14:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
--- Comment #2 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
A "legal" testcase w/o UB (and may have some usage in practice):
typedef __INT8_TYPE__ i8;
typedef __INT32_TYPE__ i32;
i8 d[16];
i32 f(i32 x) {
int i;
for (i = 0; i < 16; i++) {
__INT32_TYPE__ t = (__INT32_TYPE__) d[i] >> 31;
x &= t;
}
return x;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/101922] mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
2021-08-15 12:21 ` [Bug target/101922] " xry111 at mengyan1223 dot wang
2021-08-20 14:49 ` xry111 at mengyan1223 dot wang
@ 2021-08-20 17:33 ` xry111 at mengyan1223 dot wang
2021-08-23 5:41 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-08-20 17:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
Xi Ruoyao <xry111 at mengyan1223 dot wang> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #3 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-August/577849.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/101922] mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
` (2 preceding siblings ...)
2021-08-20 17:33 ` xry111 at mengyan1223 dot wang
@ 2021-08-23 5:41 ` cvs-commit at gcc dot gnu.org
2021-08-23 6:30 ` xry111 at mengyan1223 dot wang
2022-12-25 0:02 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-23 5:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Xi Ruoyao <xry111@gcc.gnu.org>:
https://gcc.gnu.org/g:f93f0868919ab32bfbc24adb40158298031a4d58
commit r12-3063-gf93f0868919ab32bfbc24adb40158298031a4d58
Author: Xi Ruoyao <xry111@mengyan1223.wang>
Date: Fri Aug 20 22:52:57 2021 +0800
mips: msa: truncate immediate shift amount [PR101922]
When -mloongson-mmi is enabled, SHIFT_COUNT_TRUNCATED is turned off.
This causes untruncated immediate shift amount outputed into the asm,
and the GNU assembler refuses to assemble it.
Truncate immediate shift amount when outputing the asm instruction to
make GAS happy again.
gcc/
PR target/101922
* config/mips/mips-protos.h (mips_msa_output_shift_immediate):
Declare.
* config/mips/mips.c (mips_msa_output_shift_immediate): New
function.
* config/mips/mips-msa.md (vashl<mode>3, vashr<mode>3,
vlshr<mode>3): Call it.
gcc/testsuite/
PR target/101922
* gcc.target/mips/pr101922.c: New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/101922] mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
` (3 preceding siblings ...)
2021-08-23 5:41 ` cvs-commit at gcc dot gnu.org
@ 2021-08-23 6:30 ` xry111 at mengyan1223 dot wang
2022-12-25 0:02 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-08-23 6:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
Xi Ruoyao <xry111 at mengyan1223 dot wang> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
Fixed in trunk.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug target/101922] mips: illegal instruction at -O3 with -mmsa -mloongson-mmi
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
` (4 preceding siblings ...)
2021-08-23 6:30 ` xry111 at mengyan1223 dot wang
@ 2022-12-25 0:02 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-25 0:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-12-25 0:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 12:18 [Bug target/101922] New: mips: illegal instruction at -O3 with -mmsa -mloongson-mmi xry111 at mengyan1223 dot wang
2021-08-15 12:21 ` [Bug target/101922] " xry111 at mengyan1223 dot wang
2021-08-20 14:49 ` xry111 at mengyan1223 dot wang
2021-08-20 17:33 ` xry111 at mengyan1223 dot wang
2021-08-23 5:41 ` cvs-commit at gcc dot gnu.org
2021-08-23 6:30 ` xry111 at mengyan1223 dot wang
2022-12-25 0:02 ` 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).