[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 Peter Bergner changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #8 from Peter Bergner --- Fixed on trunk.
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 --- Comment #7 from Peter Bergner --- Author: bergner Date: Wed Mar 27 16:59:15 2019 New Revision: 269969 URL: https://gcc.gnu.org/viewcvs?rev=269969=gcc=rev Log: gcc/ PR rtl-optimization/89313 * function.c (matching_constraint_num): New static function. (match_asm_constraints_1): Use it. Fixup white space and comment. Don't replace inputs with non-matching constraints which conflict with early clobber outputs. gcc/testsuite/ PR rtl-optimization/89313 * gcc.dg/pr89313.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr89313.c Modified: trunk/gcc/ChangeLog trunk/gcc/function.c trunk/gcc/testsuite/ChangeLog
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 Jakub Jelinek changed: What|Removed |Added Priority|P3 |P1 CC||jakub at gcc dot gnu.org
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 Peter Bergner changed: What|Removed |Added Keywords|ice-on-invalid-code |ice-on-valid-code Target|x86_64-pc-linux-gnu |x86_64-pc-linux-gnu, ||powerpc*-linux URL||https://gcc.gnu.org/ml/gcc- ||patches/2019-02/msg01728.ht ||ml --- Comment #6 from Peter Bergner --- As part of some offline discussions, it was determined that the asm usage is valid and should be handled, so I changed the keywords to ice-on-valid-code. Patch submitted that fixes the asmcons pass to handle this scenario.
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 Richard Biener changed: What|Removed |Added Target Milestone|--- |9.0
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 --- Comment #5 from Peter Bergner --- I'm testing a patch that gives a better error message and eliminates the ICE: [bergner@dagger1 PR89313]$ cat pr89313.i long f; long g (void) { register long z asm ("rax"); asm ("foo %0, %1, %2" : "=" (z) : "r" (f), "0" (f)); return z; } [bergner@dagger1 PR89313]$ /home/bergner/gcc/build/gcc-fsf-mainline-pr89313-debug/gcc/xgcc -B/home/bergner/gcc/build/gcc-fsf-mainline-pr89313-debug/gcc -O2 -S pr89313.i pr89313.i: In function āgā: pr89313.i:5:3: error: incompatible constraint usage for input operands when paired with an early clobber operand 5 | asm ("foo %0, %1, %2" : "=" (z) : "r" (f), "0" (f)); | ^~~ [bergner@dagger1 PR89313]$
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 --- Comment #4 from Peter Bergner --- Actually, the error message: z1.c:7:1: error: unable to generate reloads for impossible constraints: is a new LRA test that I added as part of one of my other commits that is catching the illegal register constraints being used, so this is a correct error message. That said, we probably should still catch this earlier in expand_asm_stmt().
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 Peter Bergner changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |bergner at gcc dot gnu.org --- Comment #3 from Peter Bergner --- This is not a bug in my code, it's just that before my commit, we did not catch the illegal asm constraint usage and LRA "fixed" up the code without complaining, but given it generated code different than what the used requested, it silently generated "wrong" code. With my commit, we're now generating code that LRA knows is wrong and so ICEs. I think the fix is to catch the illegal asm constraint usage and emit a useful error message, similar to what I did for PR87600 (r265942). I'll see if I add some extra test(s) to catch this scenario. I'm actually surprised the tests I added didn't catch this already, so there must be something special about this test case I didn't check for.
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 --- Comment #2 from Peter Bergner --- I'll have a look.
[Bug rtl-optimization/89313] [9 Regression] ICE in process_alt_operands, at lra-constraints.c:2962
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89313 Martin Sebor changed: What|Removed |Added Keywords||ice-on-invalid-code Status|UNCONFIRMED |NEW Last reconfirmed||2019-02-12 CC||bergner at gcc dot gnu.org, ||msebor at gcc dot gnu.org Component|c |rtl-optimization Ever confirmed|0 |1 --- Comment #1 from Martin Sebor --- Confirmed. Bisection points to r264897: r264897 | bergner | 2018-10-05 22:12:30 -0400 (Fri, 05 Oct 2018) | 26 lines gcc/ PR rtl-optimization/86939 PR rtl-optimization/87479 * ira.h (non_conflicting_reg_copy_p): New prototype. * ira-lives.c (ignore_reg_for_conflicts): New static variable. (make_hard_regno_dead): Don't add conflicts for register ignore_reg_for_conflicts. (make_object_dead): Likewise. (non_conflicting_reg_copy_p): New function. (process_bb_node_lives): Set ignore_reg_for_conflicts for copies. Remove special conflict handling of REAL_PIC_OFFSET_TABLE_REGNUM. * lra-lives.c (ignore_reg_for_conflicts): New static variable. (make_hard_regno_dead): Don't add conflicts for register ignore_reg_for_conflicts. Remove special conflict handling of REAL_PIC_OFFSET_TABLE_REGNUM. Remove now unused argument check_pic_pseudo_p and update callers. (mark_pseudo_dead): Don't add conflicts for register ignore_reg_for_conflicts. (process_bb_lives): Set ignore_reg_for_conflicts for copies.