Hide Forgot
Description of problem: http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=357072 shows an internal compiler error while building llvm. This is reproducable with a llvm-3.0-1.fc17 build. Version-Release number of selected component (if applicable): gcc-4.7.0-0.7.fc17.ppc64 How reproducible: always Steps to Reproduce: 1. ppc-koji build --scratch f17 llvm-3.0-1.fc17.src.rpm Actual results: http://ppc.koji.fedoraproject.org/koji/getfile?taskID=357074&name=build.log Additional info: I've reproduced it on power05, you can get to it with mock -r fedora-rawhide-ppc64 --uniqueext=kh shell cd /builddir/build/BUILD/llvm-3.0.src/lib/CodeGen/SelectionDAG g++ -I/builddir/build/BUILD/llvm-3.0.src/include -I/builddir/build/BUILD/llvm-3.0.src/lib/CodeGen/SelectionDAG -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/builddir/build/BUILD/llvm-3.0.src/lib/CodeGen/SelectionDAG/Release/DAGCombiner.d.tmp" -MT "/builddir/build/BUILD/llvm-3.0.src/lib/CodeGen/SelectionDAG/Release/DAGCombiner.o" -MT "/builddir/build/BUILD/llvm-3.0.src/lib/CodeGen/SelectionDAG/Release/DAGCombiner.d" DAGCombiner.cpp -o /builddir/build/BUILD/llvm-3.0.src/lib/CodeGen/SelectionDAG/Release/DAGCombiner.o
Created attachment 556089 [details] preprocessed source
Confirmed and it ICE's with gcc mainline too. I'll have a closer look.
Created attachment 556129 [details] rh782868.ii Slightly reduced testcase for -O2 -m64.
We ICE when we try and do a BLK move from a reg:TI. This seems to fix it: Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c (revision 183280) +++ gcc/emit-rtl.c (working copy) @@ -1401,6 +1401,9 @@ operand_subword (rtx op, unsigned int of return replace_equiv_address (new_rtx, XEXP (new_rtx, 0)); } + if (REG_P (op) && mode == BLKmode) + mode = GET_MODE (op); + /* Rest can be handled by simplify_subreg. */ return simplify_gen_subreg (word_mode, op, mode, (offset * UNITS_PER_WORD)); } In GCC 4.6, we don't go down this path, because we fail the load_register_parameters() test: else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode) I'll bootstrap/regtest the patch above.