| Summary: | error: qsort comparator not anti-commutative: -1, -1 on aarch64 in sched1 | ||
|---|---|---|---|
| Product: | gcc | Reporter: | Martin Liška <marxin> |
| Component: | rtl-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | abel, amonakov |
| Priority: | P3 | ||
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99469 | ||
| Host: | x86_64-unknown-linux-gnu | Target: | aarch64-linux-gnu |
| Build: | Known to work: | ||
| Known to fail: | Last reconfirmed: | 2018-02-26 00:00:00 | |
| Bug Depends on: | |||
| Bug Blocks: | 82407, 85099 | ||
|
Description
Martin Liška
2018-02-26 08:48:36 UTC
Sorry, I cannot reproduce this. I've built a cross-compiler from today's trunk via 'configure --target aarch64-linux-gnu && make all-gcc' (i.e. just to cc1plus, no binutils etc.) and it doesn't abort. If possible please add 'g++ -v' output, svn revision, and any other info that can help me reproduce the issue. Bah, built a wrong branch, not the trunk. I'll recheck later, sorry for the noise. Confirmed. Our comparator breaks here:
/* Prefer SCHED_GROUP_P insns to any others. */
if (SCHED_GROUP_P (tmp_insn) != SCHED_GROUP_P (tmp2_insn))
{
if (VINSN_UNIQUE_P (tmp_vinsn) && VINSN_UNIQUE_P (tmp2_vinsn))
return SCHED_GROUP_P (tmp2_insn) ? 1 : -1;
/* Now uniqueness means SCHED_GROUP_P is set, because schedule groups
cannot be cloned. */
if (VINSN_UNIQUE_P (tmp2_vinsn))
return 1;
return -1;
}
when we have two non-unique insns such that one is in a sched group. That is not supposed to happen actually, since SCHED_GROUP_P should imply VINSN_UNIQUE_P. This invariant is broken when sched_macro_fuse_insns sets SCHED_GROUP_P without looking at deps->readonly.
So while we could get rid of the issue by rewriting the problematic sel-sched code in terms of SCHED_GROUP_P only, lack of deps->readonly check for macro-fusion seems like a bigger issue and should be fixed too.
Author: amonakov Date: Wed Apr 11 14:36:04 2018 New Revision: 259322 URL: https://gcc.gnu.org/viewcvs?rev=259322&root=gcc&view=rev Log: sched-deps: respect deps->readonly in macro-fusion (PR 84566) PR rtl-optimization/84566 * sched-deps.c (sched_analyze_insn): Check deps->readonly when invoking sched_macro_fuse_insns. Modified: trunk/gcc/ChangeLog trunk/gcc/sched-deps.c Fixed. |