On 1/31/15 13:52, Chen Gang S wrote: > On 1/31/15 07:00, Mike Stump wrote: >> On Jan 30, 2015, at 2:58 PM, Chen Gang S <gang.chen@xxxxxxxxxxxxx> wrote: >>> After finish analyzing the related warnings for tile, for me, they are >>> neither tile's issues nor gcc common implementation issues: >> >> ? They all look like they can be fixed in the port. >> >> Why not use :P? From i386: >> >> ;; This mode iterator allows :P to be used for patterns that operate on >> ;; pointer-sized quantities. Exactly one of the two alternatives will match. >> (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) >> >> (define_insn "*tls_global_dynamic_64_<mode>" >> [(set (match_operand:P 0 "register_operand" "=a") >> (call:P >> (mem:QI (match_operand 2 "constant_call_address_operand" "Bz")) >> (match_operand 3))) >> (unspec:P [(match_operand 1 "tls_symbolic_operand")] >> UNSPEC_TLS_GD)] >> “TARGET_64BIT" >> > > OK, thanks I shall try, hope I can finish within today (this month). After try, it will report compiling error, the related information is below: Modification: diff --git a/gcc/config/tilegx/tilegx.md b/gcc/config/tilegx/tilegx.md index 7ece171..fb9c097 100644 --- a/gcc/config/tilegx/tilegx.md +++ b/gcc/config/tilegx/tilegx.md @@ -281,6 +281,8 @@ (define_mode_iterator FI48MODE [SF DF SI DI]) (define_mode_iterator VEC48MODE [V8QI V4HI]) (define_mode_iterator VEC248MODE [V8QI V4HI V2SI]) +(define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode") + (HI "Pmode == HImode") (QI "Pmode == QImode")]) (define_mode_attr n [(QI "1") (HI "2") (SI "4") (DI "") (V8QI "1") (V4HI "2") (V2SI "4")]) @@ -2625,7 +2627,7 @@ [(set_attr "type" "X1")]) (define_insn "indirect_jump" - [(set (pc) (match_operand 0 "pointer_operand" "rO"))] + [(set (pc) (match_operand:P 0 "pointer_operand" "rO"))] "" "jr\t%r0" [(set_attr "type" "Y1")]) The related error: g++ -c -DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -Ic -I../../gcc-tile-new/gcc -I../../gcc-tile-new/gcc/c -I../../gcc-tile-new/gcc/../include -I../../gcc-tile-new/gcc/../libcpp/include -I../../gcc-tile-new/gcc/../libdecnumber -I../../gcc-tile-new/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-tile-new/gcc/../libbacktrace -o c/c-lang.o -MT c/c-lang.o -MMD -MP -MF c/.deps/c-lang.TPo ../../gcc-tile-new/gcc/c/c-lang.c In file included from ./tm.h:30:0, from ../../gcc-tile-new/gcc/c/c-lang.c:24: ./insn-flags.h:114:0: warning: "HAVE_indirect_jump" redefined #define HAVE_indirect_jump (Pmode == DImode) ^ ./insn-flags.h:113:0: note: this is the location of the previous definition #define HAVE_indirect_jump (Pmode == SImode) ^ ./insn-flags.h:796:58: error: ‘rtx_def* gen_indirect_jump(rtx)’ was declared ‘extern’ and later ‘static’ [-fpermissive] static inline rtx gen_indirect_jump (rtx); ^ ./insn-flags.h:795:19: note: previous declaration of ‘rtx_def* gen_indirect_jump(rtx)’ extern rtx gen_indirect_jump (rtx); ^ ./insn-flags.h: In function ‘rtx_def* gen_indirect_jump(rtx)’: ./insn-flags.h:804:1: error: redefinition of ‘rtx_def* gen_indirect_jump(rtx)’ gen_indirect_jump(rtx ARG_UNUSED (a)) ^ ./insn-flags.h:798:1: note: ‘rtx_def* gen_indirect_jump(rtx)’ previously defined here gen_indirect_jump(rtx ARG_UNUSED (a)) ^ Do we need additional limitition/completement to follow with the related define_insn? And if we can really let pointer_operand has type, I guess, we also need remove the related tile code in "gcc/config/tilegx/tilegx.c" (original code assumed that pointer_operand is VOIDmode): 3604 /* pointer_operand and pmode_register_operand operands do 3605 not specify a mode, so use the operand's mode instead 3606 (which should always be right by the time we get here, 3607 except for constants, which are VOIDmode). */ 3608 if (opmode == VOIDmode) 3609 { 3610 machine_mode m = GET_MODE (op[opnum]); 3611 gcc_assert (m == Pmode || m == VOIDmode); 3612 opmode = Pmode; 3613 } Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed