Patchwork [aarch64] Fix asm-subreg-1.c ICE

mail settings
Submitter Hurugalawadi, Naveen
Date Nov. 28, 2012, 4:50 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/202363/
State New
Headers show


Hurugalawadi, Naveen - Nov. 28, 2012, 4:50 a.m.

Please find attached the patch “asm-subreg.patch” for aarch64 which
fixes ICE for /gcc.dg/torture/asm-subreg-1.c testcase.

The error was the result of reload problems in
“aarch64_load_symref_appropriately” function.

The higher part of symbol_ref moved to temporary RTX “tmp_reg” does
not contain the exact value. The dumps showed that (CONST_INT 0) is
moved into the temporary RTX.
When the higher part of symbol_ref was added with the temporary rtx
and moved into the “dest”, it seg faults due to reload issues.

Hence, the transfer of symbol_ref is handled slightly in a modified
manner which fixes the ICE.
Please review the patch and let me know your comments on the same.



--- gcc/config/aarch64/aarch64.c	2012-11-22 16:23:21.147121486 +0530
+++ gcc/config/aarch64/aarch64.c	2012-11-27 16:54:04.412608356 +0530
@@ -515,9 +515,9 @@  aarch64_load_symref_appropriately (rtx d
 	    tmp_reg =  gen_reg_rtx (Pmode);
-	emit_move_insn (tmp_reg, gen_rtx_HIGH (Pmode, imm));
-	emit_insn (gen_add_losym (dest, tmp_reg, imm));
+	emit_move_insn (dest, gen_rtx_HIGH (Pmode, imm));
+	emit_insn (gen_add_losym (tmp_reg, dest, imm));
+	emit_move_insn (dest, tmp_reg);