[hellogcc] Re: how can I write a right V32QI Unpack Low Data insn pattern?

  • From: Liu <proljc@xxxxxxxxx>
  • To: Ian Lance Taylor <iant@xxxxxxxxxx>
  • Date: Wed, 2 Mar 2011 15:56:57 +0800

On Tue, Mar 1, 2011 at 7:29 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
> Liu <proljc@xxxxxxxxx> writes:
>
>> I write a v16hi mode Unpack Low Data insn pattern and it is OK. v8si
>> and v4di modes are OK, too.
>> But the v32qi mode Unpack Low Data insn pattern get error like:
>> ../../gcc-4.5.1/gcc/config/mips/hr.md:509: error: expected identifier
>> or '(' before 'goto'
>> ../../gcc-4.5.1/gcc/config/mips/hr.md:511: error: expected '=', ',',
>> ';', 'asm' or '__attribute__' before ':' token
>> anyone will tell me what's wrong with my code?
>
> Looks like something in a .h file has #define'd something that your .md
> file is using.  I can't tell what it is from the code fragment here.  If
> it's not obvious, you are going to have to look at the generated file,
> and possibly even the preprocessed version of the generated file.
>
> Ian
>

hi Ian, thank you for reply.

I didn't find something in a.h has #define used by my .md file.
but I find error at insn-recog.c.
When I delete all "#line xxx" in insn-recog.c, compile it as:
gcc -c  -g -O0 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition
-Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.5.1/gcc
-I../../gcc-4.5.1/gcc/. -I../../gcc-4.5.1/gcc/../include
-I../../gcc-4.5.1/gcc/../libcpp/include -I/cross-tools/include
-I/cross-tools/include  -I../../gcc-4.5.1/gcc/../libdecnumber
-I../../gcc-4.5.1/gcc/../libdecnumber/dpd -I../libdecnumber
-I/cross-tools/include  -I/cross-tools/include -DCLOOG_PPL_BACKEND
insn-recog.c -o insn-recog.o

I get a lot of errors like this:
insn-recog.c: In function 'recog_21':
insn-recog.c:24754: error: expected expression before '{' token
insn-recog.c:24760: error: expected expression before '|' token
insn-recog.c:24766: error: expected expression before '}' token
insn-recog.c:24766: error: expected ')' before '}' token
insn-recog.c:24766: error: expected ')' before '}' token
insn-recog.c:24766: error: expected ';' before '}' token
insn-recog.c:24108: error: label 'ret0' used but not defined
insn-recog.c:24104: error: label 'L9397' used but not defined
insn-recog.c: At top level:
insn-recog.c:24766: error: expected identifier or '(' before ']' token
insn-recog.c:24767: error: expected identifier or '(' before 'if'
insn-recog.c:24769: error: expected identifier or '(' before 'goto'
insn-recog.c:24771: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24773: error: expected identifier or '(' before 'if'
insn-recog.c:24775: error: expected identifier or '(' before 'goto'
insn-recog.c:24777: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24778: error: stray '\177' in program
insn-recog.c:24779: error: expected identifier or '(' before 'if'
insn-recog.c:24781: error: expected identifier or '(' before 'goto'
insn-recog.c:24783: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24784: error: stray '\200' in program
insn-recog.c:24785: error: expected identifier or '(' before 'if'
insn-recog.c:24791: error: expected identifier or '(' before 'goto'
insn-recog.c:24793: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24795: error: expected identifier or '(' before 'if'
insn-recog.c:24797: error: expected identifier or '(' before 'goto'
insn-recog.c:24799: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24809: error: expected identifier or '(' before 'goto'
insn-recog.c:24811: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24813: error: expected identifier or '(' before 'if'
insn-recog.c:24818: error: expected identifier or '(' before 'goto'
insn-recog.c:24820: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24822: error: expected identifier or '(' before 'if'
insn-recog.c:24825: error: expected identifier or '(' before 'goto'
insn-recog.c:24827: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24829: error: expected identifier or '(' before 'if'
insn-recog.c:24834: error: expected identifier or '(' before 'goto'
insn-recog.c:24836: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24842: error: expected identifier or '(' before 'goto'
insn-recog.c:24844: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24846: error: expected identifier or '(' before 'if'
insn-recog.c:24851: error: expected identifier or '(' before 'goto'
insn-recog.c:24853: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24855: error: expected identifier or '(' before 'if'
insn-recog.c:24858: error: expected identifier or '(' before 'goto'
insn-recog.c:24860: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24862: error: expected identifier or '(' before 'if'
insn-recog.c:24867: error: expected identifier or '(' before 'goto'
insn-recog.c:24869: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24875: error: expected identifier or '(' before 'goto'
insn-recog.c:24876: error: expected '=', ',', ';', 'asm' or
'__attribute__' before ':' token
insn-recog.c:24878: error: expected identifier or '(' before '}' token

The wrong code is :
 L9284: ATTRIBUTE_UNUSED_LABEL
  x3 = XEXP (x2, {);
  if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (13)])
    goto L9285;
  goto ret0;

 L9285: ATTRIBUTE_UNUSED_LABEL
  x3 = XEXP (x2, |);
  if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (45)])
    goto L9286;
  goto ret0;

 L9286: ATTRIBUTE_UNUSED_LABEL
  x3 = XEXP (x2, });
  if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (14)])
    goto L9287;
  goto ret0;

 L9287: ATTRIBUTE_UNUSED_LABEL
  x3 = XEXP (x2, ~);
  if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (46)])
    goto L9288;
  goto ret0;

 L9288: ATTRIBUTE_UNUSED_LABEL
  x3 = XEXP (x2,  );
  if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (15)])
    goto L9289;
  goto ret0;

 L9289: ATTRIBUTE_UNUSED_LABEL
  x3 = XEXP (x2,  );
  if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (47)]
      &&
(TARGET_HR_VECTORS))
    {
      return 1072;  /* hr_vpunpcklbh */
    }
  goto ret0;

It's so weird!

Other related posts: