Bug 1788104
Summary: | internal compiler error: in final_scan_insn when building MariaDB on aarch64 | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | vladbogolin | ||||
Component: | gcc | Assignee: | Marek Polacek <mpolacek> | ||||
Status: | CLOSED WONTFIX | QA Contact: | Alexandra Petlanová Hájková <ahajkova> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 7.6 | CC: | fweimer, jakub, law, ohudlick, sipoyare | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | aarch64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2020-01-13 19:29:12 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1782203 | ||||||
Attachments: |
|
Description
vladbogolin
2020-01-06 12:43:00 UTC
I think this is upstream PR67143, except that the patch as is doesn't really work, because as can be seen in tmp-mddump.md, unlike GCC 5, GCC 4.8 didn't support using mode attributes in code attributes as the patch uses. The "IJ" from the code attribute works fine, but instead of having there "K" or "L" (the former for QI/HI/SImode and latter for DImode for xor/ior/and, tmp-mddump.md contains unexpanded <lconst_atomic>. The following seems to work for the above preprocessed source instead (or we could split the 3 define_insn_and_split patterns, having one for plus/minus and noather one for xor/and/ior, or having one for QI/HI/SImode and another one for DImode. --- gcc/config/aarch64/atomics.md.jj 2015-06-18 16:33:14.157720233 +0200 +++ gcc/config/aarch64/atomics.md 2020-01-07 16:52:29.012105743 +0100 @@ -115,16 +115,20 @@ } ) +(define_code_attr const_atomic + [(plus "no,yes") (minus "no,yes") + (xor "yes,no") (ior "yes,no") (and "yes,no")]) + (define_insn_and_split "atomic_<atomic_optab><mode>" - [(set (match_operand:ALLI 0 "aarch64_sync_memory_operand" "+Q") + [(set (match_operand:ALLI 0 "aarch64_sync_memory_operand" "+Q,Q") (unspec_volatile:ALLI [(atomic_op:ALLI (match_dup 0) - (match_operand:ALLI 1 "<atomic_op_operand>" "r<lconst_atomic>")) + (match_operand:ALLI 1 "<atomic_op_operand>" "r<lconst_atomic>,rIJ")) (match_operand:SI 2 "const_int_operand")] ;; model UNSPECV_ATOMIC_OP)) (clobber (reg:CC CC_REGNUM)) - (clobber (match_scratch:ALLI 3 "=&r")) - (clobber (match_scratch:SI 4 "=&r"))] + (clobber (match_scratch:ALLI 3 "=&r,&r")) + (clobber (match_scratch:SI 4 "=&r,&r"))] "" "#" "&& reload_completed" @@ -134,6 +138,7 @@ operands[1], operands[2], operands[4]); DONE; } + [(set_attr "enabled" "<const_atomic>")] ) (define_insn_and_split "atomic_nand<mode>" @@ -159,17 +164,17 @@ ) (define_insn_and_split "atomic_fetch_<atomic_optab><mode>" - [(set (match_operand:ALLI 0 "register_operand" "=&r") - (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q")) + [(set (match_operand:ALLI 0 "register_operand" "=&r,&r") + (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q,Q")) (set (match_dup 1) (unspec_volatile:ALLI [(atomic_op:ALLI (match_dup 1) - (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>")) + (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>,rIJ")) (match_operand:SI 3 "const_int_operand")] ;; model UNSPECV_ATOMIC_OP)) (clobber (reg:CC CC_REGNUM)) - (clobber (match_scratch:ALLI 4 "=&r")) - (clobber (match_scratch:SI 5 "=&r"))] + (clobber (match_scratch:ALLI 4 "=&r,&r")) + (clobber (match_scratch:SI 5 "=&r,&r"))] "" "#" "&& reload_completed" @@ -179,6 +184,7 @@ operands[2], operands[3], operands[5]); DONE; } + [(set_attr "enabled" "<const_atomic>")] ) (define_insn_and_split "atomic_fetch_nand<mode>" @@ -206,17 +212,17 @@ ) (define_insn_and_split "atomic_<atomic_optab>_fetch<mode>" - [(set (match_operand:ALLI 0 "register_operand" "=&r") + [(set (match_operand:ALLI 0 "register_operand" "=&r,&r") (atomic_op:ALLI - (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q") - (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>"))) + (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q,Q") + (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>,rIJ"))) (set (match_dup 1) (unspec_volatile:ALLI [(match_dup 1) (match_dup 2) (match_operand:SI 3 "const_int_operand")] ;; model UNSPECV_ATOMIC_OP)) (clobber (reg:CC CC_REGNUM)) - (clobber (match_scratch:SI 4 "=&r"))] + (clobber (match_scratch:SI 4 "=&r,&r"))] "" "#" "&& reload_completed" @@ -226,6 +232,7 @@ operands[2], operands[3], operands[4]); DONE; } + [(set_attr "enabled" "<const_atomic>")] ) (define_insn_and_split "atomic_nand_fetch<mode>" Or we could backport whatever gen* change made the backport to work, but guess that one would require inspection of the insn* files before/after on all architectures and verify without the backport nothing changed and with the backport only the 6 expanded define_insn_and_split patterns. Let's go with Jakub's Comment 2 patch for now. So dev_ack+ and adding onto the wishlist. Given this is an aarch64 problem only, fixing it in RHEL 7.9 would not help; the only way would be to issue a z-stream. But that is reserved for critical issues only, and this BZ doesn't seem to meet the bar. Thus closing. |